public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* C++ PATCH for c++/56268 (ICE with __has_nothrow_copy)
@ 2013-02-11 15:47 Jason Merrill
  0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2013-02-11 15:47 UTC (permalink / raw)
  To: gcc-patches List

[-- Attachment #1: Type: text/plain, Size: 100 bytes --]

Another missing maybe_instantiate_noexcept.

Tested x86_64-pc-linux-gnu, applying to trunk and 4.7.

[-- Attachment #2: 56268.patch --]
[-- Type: text/x-patch, Size: 1185 bytes --]

commit 1a9ad88eb3e501aed25ca6542776aacf431c7adc
Author: Jason Merrill <jason@redhat.com>
Date:   Sat Feb 9 15:58:29 2013 -0500

    	PR c++/56268
    	* semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
    	maybe_instantiate_noexcept.

diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index f8b37c1..e3dea09 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 0000000..e1be1a0
--- /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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-02-11 15:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-11 15:47 C++ PATCH for c++/56268 (ICE with __has_nothrow_copy) Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).