rsmith added inline comments.
================
Comment at: lib/Sema/SemaOverload.cpp:11608
@@ +11607,3 @@
+
+ // Calls to deleted member functions are verboten.
+ if (Method && Method->isDeleted())
----------------
This check should happen when we build the `MemberExpr`, not when we use it. It
looks like the bug is in `Sema::BuildMemberReferenceExpr`, at around line 1050
of SemaExprMember.cpp:
bool ShouldCheckUse = true;
if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(MemberDecl)) {
// Don't diagnose the use of a virtual member function unless it's
// explicitly qualified.
if (MD->isVirtual() && !SS.isSet())
ShouldCheckUse = false;
}
// Check the use of this member.
if (ShouldCheckUse && DiagnoseUseOfDecl(MemberDecl, MemberLoc))
return ExprError();
This is wrong: we should `DiagnoseUseOfDecl` (including diagnosing the use of a
deleted function) even for a virtual function. Which tests fail if we
unconditionally `DiagnoseUseOfDecl` here?
http://reviews.llvm.org/D11334
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits