[PATCH] D10935: [Sema] Don't emit "pure virtual" warning for fully qualified calls.
Richard Smith
richard at metafoo.co.uk
Mon Jul 6 13:45:49 PDT 2015
In http://reviews.llvm.org/D10935#199903, @thakis wrote:
> 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.)
================
Comment at: lib/Sema/SemaOverload.cpp:11796
@@ +11795,3 @@
+ if (isa<CXXThisExpr>(MemExpr->getBase()->IgnoreParenCasts()) &&
+ (getLangOpts().AppleKext || !MemExpr->getQualifier())) {
+ Diag(MemExpr->getLocStart(),
----------------
Use `hasQualifier` instead of `getQualifier`.
http://reviews.llvm.org/D10935
More information about the cfe-commits
mailing list