This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/14290] New: Namespaces shadow direct struct declarations


In the following code, the Works class compiles fine, but Nowork fails to
compile with the following error. This fails the same way both with gcc 2.95.4
and 3.3.2:


$ gcc -c tstgcc.cxx
tstgcc.cxx:9: error: semicolon missing after declaration of `Nowork::X'

$ cat tstgcc.cxx
namespace ns {}

class Works {
    class X { };
    X ns; // This is ok
};

class Nowork {
    class X { } ns; // This fails
};

-- 
           Summary: Namespaces shadow direct struct declarations
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: finnag at pvv dot ntnu dot no
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: 3.3.2
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14290


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]