From: Paolo Carlini Date: Mon, 23 Oct 2017 21:37:59 +0000 (+0000) Subject: re PR c++/80449 (ICE reporting failed partial class template specialization class... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=403226f0ed25834228556e9561c1a15dc58dee34;p=gcc.git re PR c++/80449 (ICE reporting failed partial class template specialization class template argument deduction) /cp 2017-10-23 Paolo Carlini PR c++/80449 * semantics.c (finish_compound_literal): Check do_auto_deduction return value for error_mark_node. /testsuite 2017-10-23 Paolo Carlini PR c++/80449 * g++.dg/cpp1z/class-deduction46.C: New. From-SVN: r254026 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9514e9c1c27..2d9c0b133c0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2017-10-23 Paolo Carlini + + PR c++/80449 + * semantics.c (finish_compound_literal): Check do_auto_deduction + return value for error_mark_node. + 2017-10-23 Jason Merrill PR c++/77369 - wrong noexcept handling in C++14 and below diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index a512664e396..71318b924b8 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f6fd200329a..d63fd0b5389 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-10-23 Paolo Carlini + + PR c++/80449 + * g++.dg/cpp1z/class-deduction46.C: New. + 2017-10-23 Jakub Jelinek 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 index 00000000000..cf38ed65fa8 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction46.C @@ -0,0 +1,6 @@ +// PR c++/80449 +// { dg-options -std=c++17 } + +template struct C; +template<> struct C { C(int, int) {} }; +auto k = C{0, 0}; // { dg-error "cannot deduce" }