public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47068] New: [C++0x] internal compiler error on decltype(~ expression)
@ 2010-12-27 16:20 spillner at acm dot org
  2010-12-27 16:26 ` [Bug c++/47068] " paolo.carlini at oracle dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: spillner at acm dot org @ 2010-12-27 16:20 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [C++0x] internal compiler error on decltype(~
                    expression)
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: spillner@acm.org


The declaration

template <class T> struct broken {
  int member;
  typedef decltype(~ member) gcc_crashes_here;
};

generates the error message "internal compiler error: in lookup_member, at
cp/search.c:1200, Please submit a full bug report" when compiled with g++ 4.4.3
(with -std=c++0x, naturally.)

Similar code compiles without errors or warnings if any of the following
transformations are applied:
   - A literal expression (e.g. "~ 0L") is substituted for "~ member"
   - The operators !, &, -, +, or * (when member is changed to a pointer type)
are used instead of ~
   - The struct is not templated
   - The typedef is declared in a free function (even a templated free
function) rather than a class or struct
   - decltype is replaced by typeof and the code is compiled without -std=c++0x

Unfortunately I'm traveling at the moment and can't easily test on other gcc
versions.


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

end of thread, other threads:[~2011-01-01  0:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-27 16:20 [Bug c++/47068] New: [C++0x] internal compiler error on decltype(~ expression) spillner at acm dot org
2010-12-27 16:26 ` [Bug c++/47068] " paolo.carlini at oracle dot com
2010-12-27 16:26 ` paolo.carlini at oracle dot com
2010-12-28 15:34 ` jason at gcc dot gnu.org
2010-12-29  2:18 ` jason at gcc dot gnu.org
2011-01-01  0:15 ` jason at gcc dot gnu.org

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).