This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13663] [3.3/3.4/3.5 regression] gcc segfaults on/accepts invalid use of member
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jan 2004 21:29:20 -0000
- Subject: [Bug c++/13663] [3.3/3.4/3.5 regression] gcc segfaults on/accepts invalid use of member
- References: <20040112235903.13663.richard@garandnet.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-01-23 21:29 -------
The source seems to be buggy. Line 61037 should read
for ( accts.first(); accts.current(); accts.next() ) {
instead of
for ( accts.first(); accts.current(); accts.next ) {
With this fix the file compiles without problems.
But of course the compiler shouldn't go into an infinite loop
on the buggy code. Here's a reduced testcase:
========================================
struct A {};
struct B : A
{
int foo();
};
struct C
{
B b;
C() { for ( ;; b.foo ) ; }
};
========================================
GCC 2.95.x issues an error message:
PR13663.cc: In method `C::C()':
PR13663.cc:11: invalid use of member (did you forget the `&' ?)
GCC 3.3.x goes into an endless loop.
GCC 3.0-3.2.3 and GCC 3.4 and mainline accept the code.
IMHO GCC 2.95.x is right and the code should be rejected
(however, I'm not really sure about that).
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
Severity|normal |critical
Keywords|ice-on-valid-code |accepts-invalid, ice-on-
| |invalid-code, monitored
Summary|[3.3 Regression] g++ |[3.3/3.4/3.5 regression] gcc
|segfaults in cc1plus |segfaults on/accepts invalid
| |use of member
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13663