OSDN Git Service

/cp
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 May 2010 19:22:26 +0000 (19:22 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 May 2010 19:22:26 +0000 (19:22 +0000)
2010-05-04  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/43028
* pt.c (unify): Check each elt for error_mark_node.

/testsuite
2010-05-04  Paolo Carlini  <paolo.carlini@oracle.com>

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
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/initlist31.C [new file with mode: 0644]

index 3f3b68e..e186a5d 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/43028
+       * pt.c (unify): Check each elt for error_mark_node.
+
 2010-05-04  Jason Merrill  <jason@redhat.com>
 
        PR c++/38064
index fbf9b90..7561d3f 100644 (file)
@@ -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);
index 4b2fe7d..8e2ffc9 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/43028
+       * g++.dg/cpp0x/initlist31.C: New.
+
 2010-05-04  Jakub Jelinek  <jakub@redhat.com>
 
        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 (file)
index 0000000..ffc9855
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/43028
+// { dg-options "-std=c++0x" }
+
+#include <initializer_list>
+
+struct string { string(std::initializer_list<char>) { } };
+
+void f() {
+  auto y =
+  {
+    string(Equation()) // { dg-error "not declared" }
+  }; // { dg-error "unable to deduce" }
+}