re PR c++/80449 (ICE reporting failed partial class template specialization class...
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 23 Oct 2017 21:37:59 +0000 (21:37 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 23 Oct 2017 21:37:59 +0000 (21:37 +0000)
/cp
2017-10-23  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/80449
* semantics.c (finish_compound_literal): Check do_auto_deduction
return value for error_mark_node.

/testsuite
2017-10-23  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/80449
* g++.dg/cpp1z/class-deduction46.C: New.

From-SVN: r254026

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/class-deduction46.C [new file with mode: 0644]

index 9514e9c1c27892b9a9051564891f7181237d01b5..2d9c0b133c028e318c511af06ade1fa05b156224 100644 (file)
@@ -1,3 +1,9 @@
+2017-10-23  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/80449
+       * semantics.c (finish_compound_literal): Check do_auto_deduction
+       return value for error_mark_node.
+
 2017-10-23  Jason Merrill  <jason@redhat.com>
 
        PR c++/77369 - wrong noexcept handling in C++14 and below
index a512664e3966fd9186175dc129c3d5dcd3955c82..71318b924b8650b19c361794d6494bc5503d42d9 100644 (file)
@@ -2711,8 +2711,12 @@ finish_compound_literal (tree type, tree compound_literal,
 
   if (tree anode = type_uses_auto (type))
     if (CLASS_PLACEHOLDER_TEMPLATE (anode))
-      type = do_auto_deduction (type, compound_literal, anode, complain,
-                               adc_variable_type);
+      {
+       type = do_auto_deduction (type, compound_literal, anode, complain,
+                                 adc_variable_type);
+       if (type == error_mark_node)
+         return error_mark_node;
+      }
 
   if (processing_template_decl)
     {
index f6fd200329a60e8d728c35aed2d5bcca3d92e6e5..d63fd0b538935b518f48dde153f8acf9aac8a3b6 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-23  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/80449
+       * g++.dg/cpp1z/class-deduction46.C: New.
+
 2017-10-23  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/82630
diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction46.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction46.C
new file mode 100644 (file)
index 0000000..cf38ed6
--- /dev/null
@@ -0,0 +1,6 @@
+// PR c++/80449
+// { dg-options -std=c++17 }
+
+template<class S> struct C;
+template<> struct C<int> { C(int, int) {} };
+auto k = C{0, 0};  // { dg-error "cannot deduce" }