2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-04-24 19:21:12 +08:00

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.
This commit is contained in:
Jason Merrill 2020-01-27 17:55:14 -05:00
parent a5ed4958a2
commit 0968f7da26
3 changed files with 12 additions and 0 deletions
gcc
cp
testsuite/g++.dg/cpp1z

@ -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

@ -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);
}
}

@ -0,0 +1,6 @@
// PR c++/90731
// { dg-do compile { target c++17 } }
typedef void T() noexcept(true);
T t;
void t() noexcept(true);