[umbrello] [Bug 383319] Classes declared in namespaces but defined outside are not imported

Ralf Habacker bugzilla_noreply at kde.org
Wed Aug 9 16:23:30 UTC 2017


https://bugs.kde.org/show_bug.cgi?id=383319

Ralf Habacker <ralf.habacker at freenet.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |ralf.habacker at freenet.de

--- Comment #1 from Ralf Habacker <ralf.habacker at freenet.de> ---
(In reply to Daniele E. Domenichelli from comment #0)
> A class declared in this way:
> 
> ---
> namespace test {
> class test;
You declare class test to be a member of namespace test
> }
> 
> class test::foo
You define a class foo inside test, which is not declared in namespace test
above
> {
>     test();
> };
> ---

This is not supported by the c++ standard. See
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf

7.3.1.2 Namespace member definitions
2 Members of a named namespace can also be defined outside that namespace by
explicit qualification of the name being defined, provided that the entity
being defined was already declared in the namespace and the definition appears
after the point of declaration in a namespace that encloses the declaration’s
namespace.

The correct c++ fragments looks then 

---
namespace test {
class foo;
}

class test::foo
{
    test();
 };
----

Importing this code creates class test::foo.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the umbrello-devel mailing list