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:
parent
b828d12414
commit
c61dce3a81
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
12
gcc/testsuite/g++.dg/template/non-type-template-argument-1.C
Normal file
12
gcc/testsuite/g++.dg/template/non-type-template-argument-1.C
Normal 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 "" }
|
Loading…
Reference in New Issue
Block a user