Details
Diff Detail
Event Timeline
Qualified calls to virtual methods still go through the vtable in
-fapple-kext mode, so you probably don't want to change that there. (Look
for AppleKext in CodeGen and Sema.)
Interesting, thanks. I didn't know about that. I'll update the patch accordingly tomorrow.
Addressed Nico's comments. While at it added a test.
Nico, I hope this is the right way of checking.
The kext bits look good to me. I'm not sure if not warning on this at all is a good idea (it looks pretty weird), but the existing warning isn't correct. Maybe the "; overrides of 'f' in subclasses are not available in the constructor of 'A'" should just be omitted in this case? (This is probably up to Richard.)
Maybe add a note "qualified call to 'A::f' is treated as a virtual call to 'f' due to -fapple-kext"?
(Also, how about adding "has undefined behavior" before the semicolon in the warning?)
I also wonder if we should add an performsVirtualDispatch(const LangOptions &) to MemberExpr, instead of the somewhat more opaque check for a qualifier here. (There are other places where we perform a similar check, such as MarkExprReferenced and Sema::MarkMemberReferenced, which get the kext case wrong.)
lib/Sema/SemaOverload.cpp | ||
---|---|---|
11796 | Use hasQualifier instead of getQualifier. |
Use hasQualifier instead of getQualifier.