public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/29003]  New: operator name accepted in typedef
@ 2006-09-10 10:28 reichelt at gcc dot gnu dot org
  2006-09-12  5:21 ` [Bug c++/29003] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-09-10 10:28 UTC (permalink / raw)
  To: gcc-bugs

The following invalid code snippet is accepted since at least GCC 2.95.3:

============================
typedef int operator! ();
============================

With such a broken declaration it's easy to crash the compiler afterwards:

============================
struct A {};

typedef int operator! (A);

int i = !A();
============================

bug.cc:3: error: argument dependent lookup finds 'operator!'
bug.cc:5: error:   in call to 'operator!'
bug.cc:5: internal compiler error: tree check: expected function_type or
method_type, have error_mark in add_function_candidate, at cp/call.c:1327
Please submit a full bug report, [etc.]


-- 
           Summary: operator name accepted in typedef
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, accepts-invalid, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


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

* [Bug c++/29003] operator name accepted in typedef
  2006-09-10 10:28 [Bug c++/29003] New: operator name accepted in typedef reichelt at gcc dot gnu dot org
@ 2006-09-12  5:21 ` pinskia at gcc dot gnu dot org
  2007-08-25  9:41 ` tbm at cyrius dot com
  2007-08-28 20:16 ` reichelt at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-12  5:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-09-12 05:21 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-09-12 05:21:39
               date|                            |


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


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

* [Bug c++/29003] operator name accepted in typedef
  2006-09-10 10:28 [Bug c++/29003] New: operator name accepted in typedef reichelt at gcc dot gnu dot org
  2006-09-12  5:21 ` [Bug c++/29003] " pinskia at gcc dot gnu dot org
@ 2007-08-25  9:41 ` tbm at cyrius dot com
  2007-08-28 20:16 ` reichelt at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: tbm at cyrius dot com @ 2007-08-25  9:41 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 515 bytes --]



------- Comment #2 from tbm at cyrius dot com  2007-08-25 09:41 -------
I also get this ICE with 4.3, but with 4.2 I get the following instead:


(sid)25944:tbm@em64t: ~/src/a] g++-4.2 -c t.cc
t.cc:3: error: argument dependent lookup finds ‘operator!’
t.cc:5: error:   in call to ‘operator!’
t.cc:5: confused by earlier errors, bailing out
Preprocessed source stored into /tmp/ccGjUbxr.out file, please attach this to
your bugreport.


-- 


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


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

* [Bug c++/29003] operator name accepted in typedef
  2006-09-10 10:28 [Bug c++/29003] New: operator name accepted in typedef reichelt at gcc dot gnu dot org
  2006-09-12  5:21 ` [Bug c++/29003] " pinskia at gcc dot gnu dot org
  2007-08-25  9:41 ` tbm at cyrius dot com
@ 2007-08-28 20:16 ` reichelt at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-08-28 20:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from reichelt at gcc dot gnu dot org  2007-08-28 20:16 -------
The message "confused by earlier errors, bailing out" is nothing but a hidden
ICE.
In order not to bother the user with GCC's error recovery problems it replaces
the usual ICE message on release branches, if a regular error message has been
issued already.
To see the underlying ICE you have to configure the compiler with
--enable-checking.


-- 


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


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

end of thread, other threads:[~2007-08-28 20:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-10 10:28 [Bug c++/29003] New: operator name accepted in typedef reichelt at gcc dot gnu dot org
2006-09-12  5:21 ` [Bug c++/29003] " pinskia at gcc dot gnu dot org
2007-08-25  9:41 ` tbm at cyrius dot com
2007-08-28 20:16 ` reichelt at gcc dot gnu dot 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).