* pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
noexcept-specifier.
From-SVN: r249078
2017-06-09 Jason Merrill <jason@redhat.com>
+ PR c++/80384 - ICE with dependent noexcept-specifier
+ * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
+ noexcept-specifier.
+
* constexpr.c (potential_constant_expression_1): Allow 'this' capture.
2017-06-09 Jan Hubicka <hubicka@ucw.cz>
arg_type = TREE_CHAIN (arg_type))
if (dependent_type_p (TREE_VALUE (arg_type)))
return true;
+ if (cxx_dialect >= cxx1z)
+ {
+ /* A value-dependent noexcept-specifier makes the type dependent. */
+ tree spec = TYPE_RAISES_EXCEPTIONS (type);
+ if (spec && TREE_PURPOSE (spec)
+ && value_dependent_expression_p (TREE_PURPOSE (spec)))
+ return true;
+ }
return false;
}
/* -- an array type constructed from any dependent type or whose
--- /dev/null
+// PR c++/80384
+// { dg-options -std=c++17 }
+
+template<class> struct foo;
+template<bool B>
+struct foo<int() noexcept(B)> {
+ static const bool value = B;
+};
+
+static_assert(!foo<int()>::value);
+static_assert(foo<int() noexcept>::value);