aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@redhat.com>2011-02-18 08:47:56 +0000
committerDodji Seketeli <dodji@gcc.gnu.org>2011-02-18 09:47:56 +0100
commit7f7d4b122b583abdbeb0681908da858ad7149d9f (patch)
treeed7a4e3154cc3931192fde65f57e04814ee2ee8b /gcc/cp/pt.c
parent5dcddcfeea9fa9fc1c85f839e0030d077d1d3110 (diff)
downloadgcc-7f7d4b122b583abdbeb0681908da858ad7149d9f.zip
gcc-7f7d4b122b583abdbeb0681908da858ad7149d9f.tar.gz
gcc-7f7d4b122b583abdbeb0681908da858ad7149d9f.tar.bz2
re PR c++/47208 ([C++0x] ICE: in decl_constant_var_p, at cp/decl2.c:3563 with missing #include <initializer_list>)
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
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c6
1 files changed, 5 insertions, 1 deletions
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 '<type error>'
+ in the diagnostic is not really useful to the user. */
+ error ("unable to deduce %qT from %qE", type, init);
return error_mark_node;
}