From b4651bd20f476f639700b73cd01850fb957de987 Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Thu, 30 May 2019 17:31:54 +0000 Subject: Add Attribute NoThrow as an Exception Specifier Type In response to https://bugs.llvm.org/show_bug.cgi?id=33235, it became clear that the current mechanism of hacking through checks for the exception specification of a function gets confused really quickly when there are alternate exception specifiers. This patch introcues EST_NoThrow, which is the equivilent of EST_noexcept when caused by EST_noThrow. The existing implementation is left in place to cover functions with no FunctionProtoType. Differential Revision: https://reviews.llvm.org/D62435 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362119 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDeclAttr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/Sema/SemaDeclAttr.cpp') diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 84f00dbaa2..932cb18a93 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -6853,7 +6853,8 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, handleNoCfCheckAttr(S, D, AL); break; case ParsedAttr::AT_NoThrow: - handleSimpleAttribute(S, D, AL); + if (!AL.isUsedAsTypeAttr()) + handleSimpleAttribute(S, D, AL); break; case ParsedAttr::AT_CUDAShared: handleSharedAttr(S, D, AL); -- cgit v1.2.1