This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15890] [3.3/3.4/3.5 regression] internal compiler error: in c_expand_expr, at c-common.c:4138
- From: "jkherciueh at gmx dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jun 2004 14:25:10 -0000
- Subject: [Bug c++/15890] [3.3/3.4/3.5 regression] internal compiler error: in c_expand_expr, at c-common.c:4138
- References: <20040609120931.15890.jkherciueh@gmx.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jkherciueh at gmx dot net 2004-06-09 14:25 -------
> > > The code is invalid, btw: you can't declare operator delete a template
> > > this way (how is the compiler supposed to figure out the value of 'T'?).
> >
> > Sure, but if you ditch that "template< typename T >", the error
> > won't show :-)
>
> Right :-) This information is only important to us when determining
> which bugs need to be fixed first, and which are not that important
> because users can work around them by fixing their codes :-)
Fair enough. Then it might be of interest that the following code
template < typename T >
void operator delete ( void* raw ) {}
int main() {
void* a = new char;
delete a;
}
compiles without triggering any warnings (I use -Wall -pedantic). And,
I have no idea if a is actually being deleted or not. How did the compiler
figure out the value of T? Or did it not look at the template at all?
Before I forget, many thanks for looking into this and even helping me to
understand my own crappy code. That's just great! I am still struggeling
hard with the sheer complexity of C++ :-)
Best regards
Kai-Uwe
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15890