This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/15890] [3.3/3.4/3.5 regression] internal compiler error: in c_expand_expr, at c-common.c:4138


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]