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++/50400] New: compiler accepts invalid &X::Impl::Impl::Impl::.....::foo


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: unassigned@gcc.gnu.org
        ReportedBy: pluto@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


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