Problem with use of anonymous types
Gabriel Dos Reis
gdr@integrable-solutions.net
Sat May 7 21:28:00 GMT 2005
"Julian Cummings" <cummings@cacr.caltech.edu> writes:
| Hmmm... I just read through the bug reports you cited. Sounds to me like
| this is still somewhat of an open issue, as to whether the compiler should
| issue an error in these cases or simply silently discard any templated
| function as a possible match for an operation involving an unnamed type. As
You're right, the issue is still open. I think people should be
careful in closing PRs related to that issue.
I can see the reasoning behind the error but it does not make any
sense to me.
| was pointed out in the discussion, this is a *disastrous* change in the
| standard behavior of gcc because it essentially makes it impossible to
| safely use an unnamed enum type in an arithmetic operation. There is bound
| to be some template function overload declared in some header file somewhere
| that suddenly makes your code not work. I am shocked that there is no
| compiler flag made available to restore the previous behavior, especially in
| light of the fact that the disposition of this issue remains unresolved. I
Please consider filling a PR and expliclty mention the fact that the
issue is under discussion withing the C++ committee.
| have checked several other C++ compilers now (Intel icc 8.1 and IBM xlC 7.0,
| for instance) and they all accept my example.
-- Gaby
More information about the Gcc-bugs
mailing list