re PR c++/10903 ([3.3 only] g++ says: "error: object ``type_decl' not supported by dump_expr")

PR c++/10903
        * pt.c (convert_nontype_argument): Fix thinko in diagnostic.
        Improve.

From-SVN: r69435
This commit is contained in:
Gabriel Dos Reis 2003-07-16 01:43:26 +00:00 committed by Gabriel Dos Reis
parent b828d12414
commit c61dce3a81
3 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2003-07-16 Gabriel Dos Reis <gdr@integrable-solutions.net>
PR c++/10903
* pt.c (convert_nontype_argument): Fix thinko in diagnostic.
Improve.
2003-07-15 Mark Mitchell <mark@codesourcery.com>
* cp-tree.def (LOOKUP_EXPR): Remove.

View File

@ -3085,7 +3085,14 @@ convert_nontype_argument (tree type, tree expr)
}
else
{
error ("object `%E' cannot be used as template argument", expr);
if (TYPE_P (expr))
error ("type '%T' cannot be used as a value for a non-type "
"template-parameter", expr);
else if (DECL_P (expr))
error ("invalid use of '%D' as a non-type template-argument", expr);
else
error ("invalid use of '%E' as a non-type template-argument", expr);
return NULL_TREE;
}

View File

@ -0,0 +1,12 @@
struct A { static const bool b=false; };
struct B { typedef A X; };
template <bool> struct C {};
template <typename T> struct D
{
C<T::X> c; // { dg-error "invalid use" }
};
D<B> d; // { dg-error "" }