<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jul 21, 2015 at 3:26 PM, Davide Italiano <span dir="ltr"><<a href="mailto:dccitaliano@gmail.com" target="_blank">dccitaliano@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On Tue, Jul 21, 2015 at 2:59 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>
> rsmith added inline comments.<br>
><br>
> ================<br>
> Comment at: lib/Sema/SemaOverload.cpp:11608<br>
> @@ +11607,3 @@<br>
> +<br>
> +    // Calls to deleted member functions are verboten.<br>
> +    if (Method && Method->isDeleted())<br>
> ----------------<br>
> 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:<br>
><br>
>   bool ShouldCheckUse = true;<br>
>   if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(MemberDecl)) {<br>
>     // Don't diagnose the use of a virtual member function unless it's<br>
>     // explicitly qualified.<br>
>     if (MD->isVirtual() && !SS.isSet())<br>
>       ShouldCheckUse = false;<br>
>   }<br>
><br>
>   // Check the use of this member.<br>
>   if (ShouldCheckUse && DiagnoseUseOfDecl(MemberDecl, MemberLoc))<br>
>     return ExprError();<br>
><br>
> 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?<br>
><br>
<br>
</span>Luckily only one.<br></blockquote><div><br></div><div>Looks like this is testing a fix for <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D4878&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=NIqF3Xo75HvRsTt273vzjAc8H6M8lKjbmvZa9eFu1AM&s=OQ6i0NN374QeHF7fLG0pYWeMTz5b8Y4Q6zYBj9t72mo&e=">https://llvm.org/bugs/show_bug.cgi?id=4878</a> from way back in r81507 ... but the fix is wrong, and it's not clear why PR4878 was even considered to be a bug.</div><div><br></div><div>(As to why the fix is wrong, consider this:</div><div><br></div><div><div>struct S {</div><div>  virtual void f() __attribute__((deprecated));</div><div>  virtual void g() __attribute__((deprecated));</div><div>  virtual void g(int) __attribute__((deprecated));</div><div>}; </div><div>void f(S s) { s.f(); s.g(); }</div></div><div><br></div><div>We warn on the call to g() but not the call to f().)</div><div><br></div><div>My preference is to update the below testcase to match the new behavior. If that's actually a problem for someone, we can then get a description of what the actual desired behavior is and implement that.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
FAIL: Clang :: SemaCXX/attr-deprecated.cpp (5733 of 8388)<br>
******************** TEST 'Clang :: SemaCXX/attr-deprecated.cpp'<br>
FAILED ********************<br>
Script:<br>
--<br>
/exps/llvm2/build/./bin/clang -cc1 -internal-isystem<br>
/exps/llvm2/build/bin/../lib/clang/3.8.0/include -nostdsysteminc<br>
/exps/llvm2/tools/clang/test/SemaCXX/attr-deprecated.cpp -verify<br>
-fexceptions<br>
--<br>
Exit Code: 1<br>
<br>
Command Output (stderr):<br>
--<br>
error: 'warning' diagnostics seen but not expected:<br>
  File /exps/llvm2/tools/clang/test/SemaCXX/attr-deprecated.cpp Line<br>
34: 'f' is deprecated<br>
  File /exps/llvm2/tools/clang/test/SemaCXX/attr-deprecated.cpp Line<br>
50: 'f' is deprecated<br>
  File /exps/llvm2/tools/clang/test/SemaCXX/attr-deprecated.cpp Line<br>
65: 'f' is deprecated<br>
error: 'note' diagnostics seen but not expected:<br>
  File /exps/llvm2/tools/clang/test/SemaCXX/attr-deprecated.cpp Line<br>
29: 'f' has been explicitly marked deprecated here<br>
  File /exps/llvm2/tools/clang/test/SemaCXX/attr-deprecated.cpp Line<br>
29: 'f' has been explicitly marked deprecated here<br>
  File /exps/llvm2/tools/clang/test/SemaCXX/attr-deprecated.cpp Line<br>
62: 'f' has been explicitly marked deprecated here<br>
6 errors generated.<br>
<br>
--<br>
<div class=""><div class="h5">_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br></div></div>