[Bug c++/39070] [4.3/4.4 regression] ICE with typeof()

bangerth at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Feb 13 00:12:00 GMT 2009

------- Comment #4 from bangerth at gmail dot com  2009-02-13 00:12 -------
Confirmed, it also ICEs on mainline.

That's a much more serious case. I'm not entirely sure whether the code
is valid: you do

   template<typename Z> static Z& y();
   template<typename Y> static char test(typeof(y<Y>())*);

with Y=int, i.e. the argument to test() would be of type
or pointer-to-reference, which is not valid. One may argue that if template
substitution fails that the second overload of test should be chosen, though:
   template<typename Y> static int  test(...);

Since typeof is not part of the C++ standard, I doubt that anything
normative is available for this case.

Regardless of the validity of the testcase, since it used to work before
and now no longer does I would appreciate more eyes on it.



bangerth at gmail dot com changed:

           What    |Removed                     |Added
                 CC|                            |jason at gcc dot gnu dot org
            Summary|Segmentation fault          |[4.3/4.4 regression] ICE
                   |                            |with typeof()


More information about the Gcc-bugs mailing list