PR c++/66684
* typeck2.c (merge_exception_specifiers): Allow different
noexcept-specifiers if we've had errors.
From-SVN: r225086
2015-06-26 Jason Merrill <jason@redhat.com>
+ PR c++/66684
+ * typeck2.c (merge_exception_specifiers): Allow different
+ noexcept-specifiers if we've had errors.
+
PR c++/66255
* pt.c (check_unstripped_args): Split out from...
(retrieve_specialization): ...here. Allow typedefs in the type of
return add;
noex = TREE_PURPOSE (list);
gcc_checking_assert (!TREE_PURPOSE (add)
+ || errorcount
|| cp_tree_equal (noex, TREE_PURPOSE (add)));
/* Combine the dynamic-exception-specifiers, if any. */
--- /dev/null
+// PR c++/66684
+// { dg-do compile { target c++11 } }
+
+template<typename T>
+struct traits
+{
+ static constexpr bool foo() { return sizeof(T) > 1; }
+ static constexpr bool bar() { return sizeof(T) > 1; }
+};
+
+template<typename T>
+struct X
+{
+ X& operator=(X&&) noexcept(traits<T>::foo());
+};
+
+template<typename T>
+ X<T>&
+ X<T>::operator=(X&&) noexcept(traits<T>::foo() && traits<T>::bar()) // { dg-error "different exception" }
+ { return *this; }