The message for the following error:

enum e {  E3 = 1 / 0 };

is in C: error: enumerator value for 'E3' not integer constant
and in C++: error: enumerator value for 'E3' is not an integer constant

The code in C is error ("enumerator value for %qE is not an integer
constant", name);
and in C++ is  error ("enumerator value for %qD not integer constant", name);


Is there someone against fixing this? What would be the preferred message?

This arises because I am working in a patch that fixes PR28986
(overflow warnings in C++). Since currently there are not many
testcases in C++ for this (actually there are zero for the above
error), I was planning to copy the ones from the C front-end (which
are excellent and I guess they should apply to C++ most of the time).

Reply via email to