This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/188: Re: Internal compiler error with improperly specified member pointer
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/188: Re: Internal compiler error with improperly specified member pointer
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Mon, 1 May 2000 11:44:08 +0200
- References: <20000430213531.A6239@funkplanet.com>
- Resent-Cc: gcc-prs at gcc dot gnu dot org, dennis at funkplanet dot com
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de>
>Number: 188
>Category: c++
>Synopsis: Internal compiler error with improperly specified member pointer
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: unassigned
>State: analyzed
>Class: ice-on-illegal-code
>Submitter-Id: net
>Arrival-Date: Mon May 01 02:56:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Dennis Taylor <dennis@funkplanet.com>
>Release: 2.95.2
>Organization:
>Environment:
>Description:
Date: Sun, 30 Apr 2000 21:35:31 -0700
Original-Message-ID: <20000430213531.A6239@funkplanet.com>
I wrote a little half-page C++ test program that causes an
internal compiler error on my system (Red Hat 6.2 i686, gcc 2.95.2).
Note that the program is already in error; I've put comments by the
mistakes that, in combination, cause this bug. Fix one or the other, and
the internal compiler error goes away.
I've attached the relevant stuff. Hope this helps!
[dennis@bluesky src]$ uname -a
Linux bluesky 2.2.14-6.1.1 #7 Tue Apr 25 21:55:35 PDT 2000 i686 unknown
[dennis@bluesky src]$ gcc -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
[dennis@bluesky src]$ g++ -v --save-temps -O -Wall -pedantic -o test test.cpp
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/cpp -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -D__OPTIMIZE__ -Wall -pedantic -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ test.cpp test.ii
GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3
/usr/local/include
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../i686-pc-linux-gnu/include
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include
/usr/include
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/cc1plus test.ii -quiet -dumpbase test.cc -O -Wall -pedantic -version -o test.s
GNU C++ version 2.95.2 19991024 (release) (i686-pc-linux-gnu) compiled by GNU C version 2.95.2 19991024 (release).
test.cpp: In function `int main()':
test.cpp:33: warning: converting from `int (Fooble::*)()' to `int (*)()'
test.cpp:36: Internal compiler error.
test.cpp:36: Please submit a full bug report.
test.cpp:36: See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for instructions.
>How-To-Repeat:
#include <stdio.h>
class Fooble {
private:
int boink;
public:
Fooble( void );
int showboink( void );
void setboink( int n );
};
Fooble::Fooble( void ) {
boink = 55;
}
int Fooble::showboink( void ) {
printf( "boink: %d\n", boink );
return( boink );
}
void Fooble::setboink( int n ) {
printf( "boink set to %d\n", n );
boink = n;
}
int main( void ) {
Fooble* f = new Fooble;
int (*zot)() = &Fooble::showboink; // 1st error: should be (Fooble::*zot)()
f->showboink();
f->*zot(); // 2nd error: bad precedence, should be (f->*zot)();
f->setboink( 3 );
f->showboink();
f->*zot(); // ditto here
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: