Index: clang/include/clang/Sema/Sema.h =================================================================== --- clang/include/clang/Sema/Sema.h +++ clang/include/clang/Sema/Sema.h @@ -3070,8 +3070,7 @@ bool isValidPointerAttrType(QualType T, bool RefOkay = false); bool CheckRegparmAttr(const AttributeList &attr, unsigned &value); - bool CheckCallingConvAttr(const AttributeList &attr, CallingConv &CC, - const FunctionDecl *FD = nullptr); + bool CheckCallingConvAttr(const AttributeList &attr, CallingConv &CC); bool CheckNoReturnAttr(const AttributeList &attr); bool checkStringLiteralArgumentAttr(const AttributeList &Attr, unsigned ArgNum, StringRef &Str, Index: clang/lib/Sema/SemaDeclAttr.cpp =================================================================== --- clang/lib/Sema/SemaDeclAttr.cpp +++ clang/lib/Sema/SemaDeclAttr.cpp @@ -3869,7 +3869,7 @@ // Diagnostic is emitted elsewhere: here we store the (valid) Attr // in the Decl node for syntactic reasoning, e.g., pretty-printing. CallingConv CC; - if (S.CheckCallingConvAttr(Attr, CC, /*FD*/nullptr)) + if (S.CheckCallingConvAttr(Attr, CC)) return; if (!isa(D)) { @@ -3964,8 +3964,7 @@ } } -bool Sema::CheckCallingConvAttr(const AttributeList &attr, CallingConv &CC, - const FunctionDecl *FD) { +bool Sema::CheckCallingConvAttr(const AttributeList &attr, CallingConv &CC) { if (attr.isInvalid()) return true; @@ -4030,12 +4029,8 @@ // This convention is not valid for the target. Use the default function or // method calling convention. - bool IsCXXMethod = false, IsVariadic = false; - if (FD) { - IsCXXMethod = FD->isCXXInstanceMember(); - IsVariadic = FD->isVariadic(); - } - CC = Context.getDefaultCallingConvention(IsVariadic, IsCXXMethod); + CC = Context.getDefaultCallingConvention(/*IsVariadic=*/false, + /*IsCXXMethod=*/false); } attr.setProcessingCache((unsigned) CC);