This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]