Commit c61dce3a by Gabriel Dos Reis Committed by Gabriel Dos Reis

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
parent b828d124
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.
......
......@@ -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;
}
......
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 "" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment