Topic: core language issue 339: ill-formed example
Author: v.Abazarov@comAcast.net ("Victor Bazarov")
Date: Mon, 5 Jun 2006 15:47:14 GMT Raw View
"Krzysztof Zelechowski" wrote:
> 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.
Really? I always thought that 6.6.3/2 made flowing off the end of
a value-returning function without a 'return' statement undefined
behaviour, but not *ill-formed*... Anybody can confirm?
> 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; }
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
---
[ 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 ]