From 7f7d4b122b583abdbeb0681908da858ad7149d9f Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Fri, 18 Feb 2011 08:47:56 +0000 Subject: re PR c++/47208 ([C++0x] ICE: in decl_constant_var_p, at cp/decl2.c:3563 with missing #include ) PR c++/47208 gcc/cp/ PR c++/47208 * pt.c (do_auto_deduction): Do not mention error_mark_node in diagnostics. * semantics.c (finish_id_expression): Do not pass erroneous decl to decl_constant_var_p. gcc/testsuite/ PR c++/47208 * g++.dg/cpp0x/auto21.C: New test. From-SVN: r170268 --- gcc/cp/pt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/cp/pt.c') diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 02b8d15..4990636 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -18926,7 +18926,11 @@ do_auto_deduction (tree type, tree init, tree auto_node) DEDUCE_CALL, LOOKUP_NORMAL); if (val > 0) { - error ("unable to deduce %qT from %qE", type, init); + if (type && type != error_mark_node) + /* If type is error_mark_node a diagnostic must have been + emitted by now. Also, having a mention to '' + in the diagnostic is not really useful to the user. */ + error ("unable to deduce %qT from %qE", type, init); return error_mark_node; } -- cgit v1.1