re PR c++/43028 ([C++0x] internal compiler error in maybe_adjust_types_for_deduction)
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 4 May 2010 19:22:26 +0000 (19:22 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 4 May 2010 19:22:26 +0000 (19:22 +0000)
/cp
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.

From-SVN: r159045

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/initlist31.C [new file with mode: 0644]

index 3f3b68ec34ab85386fa3405ea9bb3e2c6f74ebdc..e186a5d1b56657bc852f8f1937f663ac4574cb8f 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 fbf9b905c0286c7af39c29d37aa3e1b33823511a..7561d3fc9246bfbdc4fe1f79b443b02181feab2c 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 4b2fe7d57adc3d354f45744e41e132211f6a1b79..8e2ffc95194e76579cdcf1f782927c2fcbb9fbdb 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" }
+}