From 2243486f99a29bb29fc1fa4859749b220822b862 Mon Sep 17 00:00:00 2001 From: paolo Date: Tue, 4 May 2010 19:22:26 +0000 Subject: [PATCH] /cp 2010-05-04 Paolo Carlini PR c++/43028 * pt.c (unify): Check each elt for error_mark_node. /testsuite 2010-05-04 Paolo Carlini PR c++/43028 * g++.dg/cpp0x/initlist31.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159045 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/pt.c | 4 ++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/initlist31.C | 13 +++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/initlist31.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3f3b68ec34a..e186a5d1b56 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2010-05-04 Paolo Carlini + + PR c++/43028 + * pt.c (unify): Check each elt for error_mark_node. + 2010-05-04 Jason Merrill PR c++/38064 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index fbf9b905c02..7561d3fc924 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -14468,6 +14468,10 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (arg), i, elt) { int elt_strict = strict; + + if (elt == error_mark_node) + return 1; + if (!BRACE_ENCLOSED_INITIALIZER_P (elt)) { tree type = TREE_TYPE (elt); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4b2fe7d57ad..8e2ffc95194 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-05-04 Paolo Carlini + + PR c++/43028 + * g++.dg/cpp0x/initlist31.C: New. + 2010-05-04 Jakub Jelinek PR c/43981 diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist31.C b/gcc/testsuite/g++.dg/cpp0x/initlist31.C new file mode 100644 index 00000000000..ffc985567ed --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/initlist31.C @@ -0,0 +1,13 @@ +// PR c++/43028 +// { dg-options "-std=c++0x" } + +#include + +struct string { string(std::initializer_list) { } }; + +void f() { + auto y = + { + string(Equation()) // { dg-error "not declared" } + }; // { dg-error "unable to deduce" } +} -- 2.11.4.GIT