r360448 - Fix and test for assertion error in P41835.
Leonard Chan via cfe-commits
cfe-commits at lists.llvm.org
Fri May 10 11:05:15 PDT 2019
Author: leonardchan
Date: Fri May 10 11:05:15 2019
New Revision: 360448
URL: http://llvm.org/viewvc/llvm-project?rev=360448&view=rev
Log:
Fix and test for assertion error in P41835.
Modified:
cfe/trunk/lib/AST/ASTContext.cpp
cfe/trunk/test/Frontend/macro_defined_type.cpp
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=360448&r1=360447&r2=360448&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Fri May 10 11:05:15 2019
@@ -2758,6 +2758,12 @@ QualType ASTContext::getFunctionTypeWith
return getParenType(
getFunctionTypeWithExceptionSpec(PT->getInnerType(), ESI));
+ // Might be wrapped in a macro qualified type.
+ if (const auto *MQT = dyn_cast<MacroQualifiedType>(Orig))
+ return getMacroQualifiedType(
+ getFunctionTypeWithExceptionSpec(MQT->getUnderlyingType(), ESI),
+ MQT->getMacroIdentifier());
+
// Might have a calling-convention attribute.
if (const auto *AT = dyn_cast<AttributedType>(Orig))
return getAttributedType(
Modified: cfe/trunk/test/Frontend/macro_defined_type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/macro_defined_type.cpp?rev=360448&r1=360447&r2=360448&view=diff
==============================================================================
--- cfe/trunk/test/Frontend/macro_defined_type.cpp (original)
+++ cfe/trunk/test/Frontend/macro_defined_type.cpp Fri May 10 11:05:15 2019
@@ -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}}
+};
More information about the cfe-commits
mailing list