From: Jakub Jelinek Date: Thu, 13 Dec 2012 14:35:12 +0000 (+0100) Subject: re PR c++/55652 (ICE (segfault) with templates and structs) X-Git-Tag: releases/gcc-4.8.0~1384 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e9f20cf1afad895bbb73a418ee3a183d2a2ea23;p=thirdparty%2Fgcc.git re PR c++/55652 (ICE (segfault) with templates and structs) PR c++/55652 * typeck2.c (merge_exception_specifiers): Don't call operand_equal_p if noex is NULL. * g++.dg/cpp0x/noexcept19.C: New test. From-SVN: r194479 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a2228fad685f..ea4cfb203426 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2012-12-13 Jakub Jelinek + + PR c++/55652 + * typeck2.c (merge_exception_specifiers): Don't call operand_equal_p + if noex is NULL. + 2012-12-11 Jason Merrill PR c++/54883 diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index abddd4d11101..fbf50004b60c 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -1871,7 +1871,7 @@ merge_exception_specifiers (tree list, tree add, tree fn) /* If ADD is a deferred noexcept, we must have been called from process_subob_fn. For implicitly declared functions, we build up a list of functions to consider at instantiation time. */ - if (operand_equal_p (noex, boolean_true_node, 0)) + if (noex && operand_equal_p (noex, boolean_true_node, 0)) noex = NULL_TREE; gcc_assert (fn && (!noex || is_overloaded_fn (noex))); noex = build_overload (fn, noex); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a03406af0ad7..e16352a38122 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-12-13 Jakub Jelinek + + PR c++/55652 + * g++.dg/cpp0x/noexcept19.C: New test. + 2012-12-13 Richard Biener PR lto/55660 diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept19.C b/gcc/testsuite/g++.dg/cpp0x/noexcept19.C new file mode 100644 index 000000000000..12ff86e0d22b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept19.C @@ -0,0 +1,29 @@ +// PR c++/55652 +// { dg-do compile } +// { dg-options "-std=c++11" } + +template +struct A +{ + static const bool a = false; +}; + +template > +struct B +{ + B () noexcept (A ::a) {} +}; + +template +struct C +{ + X x; + Y y; +}; + +struct D +{ + D () throw (int); +}; + +C > c;