From: Jason Merrill Date: Mon, 27 Jan 2020 22:55:14 +0000 (-0500) Subject: c++: Function declared with typedef with eh-specification. X-Git-Tag: releases/gcc-9.3.0~176 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d4d55a52d44b11e7621a5b455f2a38a32b37367;p=thirdparty%2Fgcc.git 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 --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9b1e506c8ccc..43fcf822df9c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2020-01-28 Jason Merrill + PR c++/90731 + * decl.c (grokdeclarator): Propagate eh spec from typedef. + PR c++/90966 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index f3f20b55c8b5..b106d8f44adf 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -12181,6 +12181,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 000000000000..dd9924ff1b1e --- /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);