I originally tried to fix this in SemaExpr (ActOnCallExpr), putting this check just before BuildCallToMemberFunction() call, but eventaully convinced myself SemaOverload should be the right place to fix.
Thanks,
Davide
Differential D11334
[Sema] Call to deleted functions are supposed to be verboten davide on Jul 18 2015, 9:37 PM. Authored by
Details I originally tried to fix this in SemaExpr (ActOnCallExpr), putting this check just before BuildCallToMemberFunction() call, but eventaully convinced myself SemaOverload should be the right place to fix. Thanks, Davide
Diff Detail Event TimelineComment Actions I don't spend a lot of time on the internals of clang; but this looks reasonable to me.
|
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:
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?