Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 40623 - Internal Compiler error on bad syntax
Summary: Internal Compiler error on bad syntax
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-06 10:30 UTC by Greg Symons
Modified: 2005-07-15 07:34 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Preprocessed Source (assign1.gpp,725.99 KB, text/plain)
2004-02-06 10:33 UTC, Greg Symons
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Symons 2004-02-06 10:30:03 UTC
g++ -O0 -g3 -Wall -c -o assign1.o ../assign1.cpp
../assign1.cpp:99: warning: `class IntPrinter' has virtual functions but
   non-virtual destructor
I got an internal compiler error from my code when I forgot to scope my template class destructor function properly. The destructor also contains a local class, though I don't think it's related to the error. Since it results from a syntax error, it's probably not that serious, though a more helpful error message would be nice rather than blowing up. 

I'll attach preprocessed source in just a second.

Reproducible: Didn't try
Steps to Reproduce:
1.Define a template class.
2.Define the destructor of the template class outside the body of the class, however, make the following error when declaring it:
template<typename T>::~ClassName() { //code here };
Note the missing class name before the scope resolution operator
3.Compile the program containing the class

Actual Results:  
../assign1.cpp:152: Internal compiler error in grokdeclarator, at cp/decl.c:
   9857
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
make: *** [assign1.o] Error 1

Expected Results:  
Emitted an error message indicating the missing class name on the scope
resolution operator.
Comment 1 Greg Symons 2004-02-06 10:33:02 UTC
Created attachment 25088 [details]
Preprocessed Source

This preprocessed source is from the code which generated the error.
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-06 10:37:19 UTC
3.3.2 is going stable in a bit, I will rather like to fix it there (if still
and issue).
Comment 3 Greg Symons 2004-02-06 10:40:12 UTC
Sounds fine to me... like I said, it comes out of a syntax error (one which should be extremely rare... I'm not entirely sure what I was thinking when I typed that code in:) so it's easily worked around.
Comment 4 SpanKY gentoo-dev 2004-05-06 22:25:41 UTC
so is this still broken with 3.3.2 ?

you didnt attach the actual .cpp so i cant test it myself :)
Comment 5 Caleb Tennis (RETIRED) gentoo-dev 2005-07-15 07:34:13 UTC
No reply, assuming fixed.