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

             Bug #: 50400
           Summary: compiler accepts invalid
                    &X::Impl::Impl::Impl::.....::foo
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: pl...@agmk.net


struct X { struct Impl; };
struct X::Impl {
        Impl();
        void foo();
};
X::Impl::Impl() {
        void ( X::Impl::* ptr )() = &X::Impl::Impl::Impl::Impl::Impl::foo;
}

gcc-4.6-20110908 and clang++ accept this code while e.g. MSVC reports
an error: C3083: '{ctor}': the symbol to the left of a '::' must be a type

Reply via email to