The following code compiles without an error g++ -c a-bug.cc -o a-bug.o
//------------------------------------- struct X { struct Y { void method(); }; void method(); }; void X::X::X::X::method() // more than one X { } void X::X::Y::Y::Y::method() // more than one X and Y { } //------------------------------------- is this correct ? g++ -v Using built-in specs. COLLECT_GCC=../tc/bin/g++ COLLECT_LTO_WRAPPER=/home/buchmann/devel/gcc/target/host/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /home/hansbuchmann/devel/gcc/dist/gcc-4.5.0/configure -v --prefix=/home/hansbuchmann/devel/gcc/target/host --enable-languages=c,c++ --disable-threads --disable-shared --disable-multilib --disable-__cxa_atexit --with-newlib --without-headers --without-libspp --disable-nls --with-mpfr=/home/hansbuchmann/devel/gcc/target/host/../infrastructure/ Thread model: single gcc version 4.5.0 (GCC) Kind regards Hans Buchmann -- Summary: Nested classes Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: hans dot buchmann at fhnw dot ch GCC build triplet: x86_64-linux-gnu GCC host triplet: x86_64-linux-gnu GCC target triplet: x86_64-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45158