@@ -1871,7 +1871,7 @@ merge_exception_specifiers (tree list, t
/* 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);
@@ -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;