summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-12-13 14:35:12 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-12-13 14:35:12 +0000
commite2ae6969bad411fe7b4c508d15b5a70934acd7df (patch)
tree8d6601148fa8b78c438d3dac7314309e33870e31
parent80050dd328c92132ae0f7753370771b3589b8938 (diff)
downloadppe42-gcc-e2ae6969bad411fe7b4c508d15b5a70934acd7df.tar.gz
ppe42-gcc-e2ae6969bad411fe7b4c508d15b5a70934acd7df.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194479 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/typeck2.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/noexcept19.C29
4 files changed, 41 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a2228fad685..ea4cfb20342 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2012-12-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/55652
+ * typeck2.c (merge_exception_specifiers): Don't call operand_equal_p
+ if noex is NULL.
+
2012-12-11 Jason Merrill <jason@redhat.com>
PR c++/54883
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index abddd4d1110..fbf50004b60 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 a03406af0ad..e16352a3812 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-12-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/55652
+ * g++.dg/cpp0x/noexcept19.C: New test.
+
2012-12-13 Richard Biener <rguenther@suse.de>
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 00000000000..12ff86e0d22
--- /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 <typename T>
+struct A
+{
+ static const bool a = false;
+};
+
+template <typename X, typename Y = A <X>>
+struct B
+{
+ B () noexcept (A <Y>::a) {}
+};
+
+template <typename X, typename Y>
+struct C
+{
+ X x;
+ Y y;
+};
+
+struct D
+{
+ D () throw (int);
+};
+
+C <D, B <D>> c;
OpenPOWER on IntegriCloud