public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50400] New: compiler accepts invalid &X::Impl::Impl::Impl::.....::foo
@ 2011-09-15  8:18 pluto at agmk dot net
  2011-09-15 10:00 ` [Bug c++/50400] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: pluto at agmk dot net @ 2011-09-15  8:18 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/50400] compiler accepts invalid &X::Impl::Impl::Impl::.....::foo
  2011-09-15  8:18 [Bug c++/50400] New: compiler accepts invalid &X::Impl::Impl::Impl::.....::foo pluto at agmk dot net
@ 2011-09-15 10:00 ` redi at gcc dot gnu.org
  2011-09-23 11:47 ` paolo.carlini at oracle dot com
  2011-09-23 21:39 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2011-09-15 10:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-09-15 09:34:52 UTC ---
EDG accepts it too, are you suggesting MSVC is right and all the others wrong?
That would be a first ;)

See http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#318

Because the constructor Impl::Impl is not an acceptable lookup result in the
expression X::Impl::Impl::foo the second "Impl" names the class itself, and so
the code is valid and G++ is correct


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/50400] compiler accepts invalid &X::Impl::Impl::Impl::.....::foo
  2011-09-15  8:18 [Bug c++/50400] New: compiler accepts invalid &X::Impl::Impl::Impl::.....::foo pluto at agmk dot net
  2011-09-15 10:00 ` [Bug c++/50400] " redi at gcc dot gnu.org
@ 2011-09-23 11:47 ` paolo.carlini at oracle dot com
  2011-09-23 21:39 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-09-23 11:47 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-23 11:05:09 UTC ---
Closing.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/50400] compiler accepts invalid &X::Impl::Impl::Impl::.....::foo
  2011-09-15  8:18 [Bug c++/50400] New: compiler accepts invalid &X::Impl::Impl::Impl::.....::foo pluto at agmk dot net
  2011-09-15 10:00 ` [Bug c++/50400] " redi at gcc dot gnu.org
  2011-09-23 11:47 ` paolo.carlini at oracle dot com
@ 2011-09-23 21:39 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-09-23 21:39 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hans.buchmann at fhnw dot
                   |                            |ch

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-23 21:36:14 UTC ---
*** Bug 45158 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-23 21:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-15  8:18 [Bug c++/50400] New: compiler accepts invalid &X::Impl::Impl::Impl::.....::foo pluto at agmk dot net
2011-09-15 10:00 ` [Bug c++/50400] " redi at gcc dot gnu.org
2011-09-23 11:47 ` paolo.carlini at oracle dot com
2011-09-23 21:39 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).