This revision was automatically updated to reflect the committed changes. Closed by commit rGe278c138a937: [Sema] Add MacroQualified case for FunctionTypeUnwrapper (authored by leonardchan).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67992/new/ https://reviews.llvm.org/D67992 Files: clang/lib/Sema/SemaType.cpp clang/test/Frontend/macro_defined_type.cpp Index: clang/test/Frontend/macro_defined_type.cpp =================================================================== --- clang/test/Frontend/macro_defined_type.cpp +++ clang/test/Frontend/macro_defined_type.cpp @@ -19,3 +19,7 @@ struct A { _LIBCPP_FLOAT_ABI int operator()() throw(); // expected-warning{{'pcs' calling convention is not supported for this target}} }; + +// Added test for fix for PR43315 +#define a __attribute__((__cdecl__, __regparm__(0))) +int(a b)(); Index: clang/lib/Sema/SemaType.cpp =================================================================== --- clang/lib/Sema/SemaType.cpp +++ clang/lib/Sema/SemaType.cpp @@ -6325,7 +6325,8 @@ Pointer, BlockPointer, Reference, - MemberPointer + MemberPointer, + MacroQualified, }; QualType Original; @@ -6356,6 +6357,9 @@ } else if (isa<AttributedType>(Ty)) { T = cast<AttributedType>(Ty)->getEquivalentType(); Stack.push_back(Attributed); + } else if (isa<MacroQualifiedType>(Ty)) { + T = cast<MacroQualifiedType>(Ty)->getUnderlyingType(); + Stack.push_back(MacroQualified); } else { const Type *DTy = Ty->getUnqualifiedDesugaredType(); if (Ty == DTy) { @@ -6412,6 +6416,9 @@ return C.getParenType(New); } + case MacroQualified: + return wrap(C, cast<MacroQualifiedType>(Old)->getUnderlyingType(), I); + case Pointer: { QualType New = wrap(C, cast<PointerType>(Old)->getPointeeType(), I); return C.getPointerType(New);
Index: clang/test/Frontend/macro_defined_type.cpp =================================================================== --- clang/test/Frontend/macro_defined_type.cpp +++ clang/test/Frontend/macro_defined_type.cpp @@ -19,3 +19,7 @@ struct A { _LIBCPP_FLOAT_ABI int operator()() throw(); // expected-warning{{'pcs' calling convention is not supported for this target}} }; + +// Added test for fix for PR43315 +#define a __attribute__((__cdecl__, __regparm__(0))) +int(a b)(); Index: clang/lib/Sema/SemaType.cpp =================================================================== --- clang/lib/Sema/SemaType.cpp +++ clang/lib/Sema/SemaType.cpp @@ -6325,7 +6325,8 @@ Pointer, BlockPointer, Reference, - MemberPointer + MemberPointer, + MacroQualified, }; QualType Original; @@ -6356,6 +6357,9 @@ } else if (isa<AttributedType>(Ty)) { T = cast<AttributedType>(Ty)->getEquivalentType(); Stack.push_back(Attributed); + } else if (isa<MacroQualifiedType>(Ty)) { + T = cast<MacroQualifiedType>(Ty)->getUnderlyingType(); + Stack.push_back(MacroQualified); } else { const Type *DTy = Ty->getUnqualifiedDesugaredType(); if (Ty == DTy) { @@ -6412,6 +6416,9 @@ return C.getParenType(New); } + case MacroQualified: + return wrap(C, cast<MacroQualifiedType>(Old)->getUnderlyingType(), I); + case Pointer: { QualType New = wrap(C, cast<PointerType>(Old)->getPointeeType(), I); return C.getPointerType(New);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits