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

Ralf Habacker <ralf.habac...@freenet.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |ralf.habac...@freenet.de

--- Comment #1 from Ralf Habacker <ralf.habac...@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 watching all bug changes.

Reply via email to