All callers of CheckCallingConvAttr passed FD == nullptr, so just get
rid of the aspirational function arg.
Details
- Reviewers
rnk
Diff Detail
- Build Status
Buildable 2544 Build 2544: arc lint + arc unit
Event Timeline
I think you've discovered this bug:
struct F { void __attribute__((pcs("aapcs"))) f(); }; void __attribute__((pcs("aapcs"))) F::f() {}
Clang ignores the pcs convention on 32-bit x86, and because we don't have an FD here, we choose the wrong default calling convention (not thiscall) for F::f.
I think you've discovered this bug:
Hm, I guess this is a step in the wrong direction, then.
(I spun this patch after writing some code in this function that assumed I'd get a FunctionDecl where appropriate, which of course doesn't work.)
In general we can't get an FD here because we might be in the middle of parsing the declarator. The calls from SemaType.cpp in particular can't actually provide one. They would have to thread through the IsVariadic and IsCXXMethod bools based on syntactic cues (the ellipsis, member pointer declarator chunks, being the appropriate declarator chunk in a record context, i.e. what getCCForDeclaratorChunk does).