This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
New parser does not warn/error correcly in -ansi mode?
- From: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- To: <gcc at gcc dot gnu dot org>
- Date: Wed, 22 Jan 2003 11:24:30 +0100 (CET)
- Subject: New parser does not warn/error correcly in -ansi mode?
Hi!
For
template <class T>
struct Traits;
template <class T, bool f>
struct Foobar;
template <class T>
void f(const T&)
{
const bool foo = Traits<T>::bar < Traits<T>::baz;
Foobar<T, foo>::doit();
}
The compiler does not warn that the constant value of foo is not known.
The EDG frontent (Intel icpc v7) diagnoses this as
ansi.cpp(12): error: constant value is not known
Foobar<T, foo>::doit();
EDG does not error, if I change the const bool to an enum.
Thanks, Richard.
--
Richard Guenther <richard.guenther@uni-tuebingen.de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/