Topic: DRDR: core language issue 339: ill-formed example


Author: krixel@qed.pl ("Krzysztof elechowski")
Date: Fri, 2 Jun 2006 23:14:49 GMT
Raw View
The sample provided contains the following definition:

template <class T> A<sizeof(xxx((T)0))> f(T){}

This code is ill-formed for any typename T because function f must return a
value.  And the fact that this error may not be recognized until the back
end is irrelevant because Comeau C++ compiler apparently does not delay
invoking the back end until the front end has succeeded and thus it does not
report the error it is expected to report.  In order to illustrate the point
properly, it must be changed to

template <class T> A<sizeof(xxx((T)0))> *f(T){ return 0; }

Chris


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]