https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70057

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Bernd Schmidt from comment #3)
> The C++ errors become even more entertaining when you add -fpermissive:
> 
> 69972-b.cc:2:16: warning: integer overflow in expression [-Woverflow]
> 69972-b.cc:2:20: warning: overflow in constant expression [-fpermissive]
> 69972-b.cc:2:20: note: in template argument for type ‘int’ 
> 69972-b.cc: In instantiation of ‘struct S<-2147483648>’:
> 69972-b.cc:2:22:   required from here
> 69972-b.cc:1:27: warning: overflow in constant expression [-fpermissive]
> 69972-b.cc:1:27: note: in template argument for type ‘int’ 
> 69972-b.cc:1:27: warning: overflow in constant expression [-fpermissive]
> 69972-b.cc:1:27: note: in template argument for type ‘int’ 
> 69972-b.cc:1:27: warning: overflow in constant expression [-fpermissive]
> 69972-b.cc:1:27: note: in template argument for type ‘int’


The C++ FE has the tendency to give diagnostics very deep in the call stack,
where there is little knowledge of the context. It would be much better to
signal to the caller that something went wrong and let them decide what to say.
It would also probably be faster by avoiding checking error conditions multiple
times and not passing down information that is only used to provide context.

Oh, well, I guess this won't change until the GCC FEs start being used by other
GPL software that wishes to be in control of the errors (GDB compile command?
but that project seems to be dead in the water) or replaced completely by Clang
or a Clang fork like Richi proposed some time ago.

Reply via email to