From: Leonard Chan Date: Fri, 10 May 2019 18:05:15 +0000 (+0000) Subject: Fix and test for assertion error in P41835. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ab2c8ba2bdeca94b6e8990c25596601b4314f20;p=clang Fix and test for assertion error in P41835. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360448 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 1b9b7cd1b5..a2de53ca0c 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -2758,6 +2758,12 @@ QualType ASTContext::getFunctionTypeWithExceptionSpec( return getParenType( getFunctionTypeWithExceptionSpec(PT->getInnerType(), ESI)); + // Might be wrapped in a macro qualified type. + if (const auto *MQT = dyn_cast(Orig)) + return getMacroQualifiedType( + getFunctionTypeWithExceptionSpec(MQT->getUnderlyingType(), ESI), + MQT->getMacroIdentifier()); + // Might have a calling-convention attribute. if (const auto *AT = dyn_cast(Orig)) return getAttributedType( diff --git a/test/Frontend/macro_defined_type.cpp b/test/Frontend/macro_defined_type.cpp index 4e60c84038..6349526868 100644 --- a/test/Frontend/macro_defined_type.cpp +++ b/test/Frontend/macro_defined_type.cpp @@ -13,3 +13,9 @@ void Func() { auto NODEREF *auto_i_ptr2 = i_ptr; auto NODEREF auto_i2 = i; // expected-warning{{'noderef' can only be used on an array or pointer type}} } + +// Added test for fix for P41835 +#define _LIBCPP_FLOAT_ABI __attribute__((pcs("aapcs"))) +struct A { + _LIBCPP_FLOAT_ABI int operator()() throw(); // expected-warning{{'pcs' calling convention ignored for this target}} +};