]> granicus.if.org Git - clang/commitdiff
Fix and test for assertion error in P41835.
authorLeonard Chan <leonardchan@google.com>
Fri, 10 May 2019 18:05:15 +0000 (18:05 +0000)
committerLeonard Chan <leonardchan@google.com>
Fri, 10 May 2019 18:05:15 +0000 (18:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360448 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp
test/Frontend/macro_defined_type.cpp

index 1b9b7cd1b51d254ff4002fadc345499776e746ce..a2de53ca0c11c42d12181180cc9f6cb072a59002 100644 (file)
@@ -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<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(
index 4e60c8403829e9e62e9fe77606a732f1b2d0a695..63495268687f7b4db1fe379bb9313a0229c462c2 100644 (file)
@@ -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}}
+};