summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2013-02-11 15:47:46 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2013-02-11 15:47:46 +0000
commita7ddc63a88753bfe3af708b9b45d9be9b7683350 (patch)
tree5105e6f42180260efa04a494310401106c8b3e5e
parent2f5dea3018a34afffab849e6e1b8c0ae9e6951c7 (diff)
PR c++/56268
* semantics.c (classtype_has_nothrow_assign_or_copy_p): Call maybe_instantiate_noexcept. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195943 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/semantics.c1
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy-8.C19
3 files changed, 24 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c1fc4bc9296e..6172db65e75f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2013-02-09 Jason Merrill <jason@redhat.com>
+ PR c++/56268
+ * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
+ maybe_instantiate_noexcept.
+
PR c++/56247
* pt.c (eq_specializations): Set comparing_specializations.
* tree.c (cp_tree_equal): Check it.
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index f8b37c18c166..e3dea091b9a3 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -5413,6 +5413,7 @@ classtype_has_nothrow_assign_or_copy_p (tree type, bool assign_p)
else if (copy_fn_p (fn) <= 0)
continue;
+ maybe_instantiate_noexcept (fn);
if (!TYPE_NOTHROW_P (TREE_TYPE (fn)))
return false;
}
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-8.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-8.C
new file mode 100644
index 000000000000..e1be1a0a771c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-8.C
@@ -0,0 +1,19 @@
+// PR c++/56268
+// { dg-options -std=c++11 }
+
+template <class T>
+struct A {
+ A(const A&) noexcept (T::value);
+};
+
+struct B {
+ static const bool value = true;
+};
+
+template <class T>
+struct C {
+ static const bool value = __has_nothrow_copy (T);
+};
+
+#define SA(X) static_assert((X),#X)
+SA(C<A<B>>::value);