public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/c++-coroutines] c++: Function declared with typedef with eh-specification.
@ 2020-01-28 21:43 Iain D Sandoe
  0 siblings, 0 replies; only message in thread
From: Iain D Sandoe @ 2020-01-28 21:43 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0968f7da26221bfc9203cd557c8636c0a0f24018

commit 0968f7da26221bfc9203cd557c8636c0a0f24018
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Jan 27 17:55:14 2020 -0500

    c++: Function declared with typedef with eh-specification.
    
    We just need to handle the exception specification like other properties of
    a function typedef.
    
    	PR c++/90731
    	* decl.c (grokdeclarator): Propagate eh spec from typedef.

Diff:
---
 gcc/cp/ChangeLog                             | 5 +++++
 gcc/cp/decl.c                                | 1 +
 gcc/testsuite/g++.dg/cpp1z/noexcept-type22.C | 6 ++++++
 3 files changed, 12 insertions(+)

diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3d5c9a1..259b0c7 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-28  Jason Merrill  <jason@redhat.com>
+
+	PR c++/90731
+	* decl.c (grokdeclarator): Propagate eh spec from typedef.
+
 2020-01-28  Martin Liska  <mliska@suse.cz>
 
 	PR c++/92440
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index e55de5d..6ad558e 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -12848,6 +12848,7 @@ grokdeclarator (const cp_declarator *declarator,
 	  memfn_quals |= type_memfn_quals (type);
 	  rqual = type_memfn_rqual (type);
 	  type_quals = TYPE_UNQUALIFIED;
+	  raises = TYPE_RAISES_EXCEPTIONS (type);
 	}
     }
 
diff --git a/gcc/testsuite/g++.dg/cpp1z/noexcept-type22.C b/gcc/testsuite/g++.dg/cpp1z/noexcept-type22.C
new file mode 100644
index 0000000..dd9924f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/noexcept-type22.C
@@ -0,0 +1,6 @@
+// PR c++/90731
+// { dg-do compile { target c++17 } }
+
+typedef void T() noexcept(true);
+T t;
+void t() noexcept(true);


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

only message in thread, other threads:[~2020-01-28 21:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-28 21:43 [gcc/devel/c++-coroutines] c++: Function declared with typedef with eh-specification Iain D Sandoe

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).