<p dir="ltr">Yep<br>
 Both of these sound like bugs and should be able to be fixed just by checking for a non-deleted definition. I'm not sure if there's a particular function to test that.</p>
<p dir="ltr">The unused variable one might crop up in defaulted functions too, in which case we'll want to check for a user provided definition.</p>
<div class="gmail_quote">On Apr 21, 2014 3:35 AM, "Nicola Gigante" <<a href="mailto:nicola.gigante@gmail.com">nicola.gigante@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello.<br>
<br>
Consider this:<br>
<br>
$ cat example.cpp<br>
void func(int x) = delete;<br>
$ clang++ -std=c++11 -fsyntax-only -Wunused-parameter -Wmissing-prototypes example.cpp<br>
example.cpp:1:6: warning: no previous prototype for function 'func' [-Wmissing-prototypes]<br>
void func(int x) = delete;<br>
     ^<br>
example.cpp:1:15: warning: unused parameter 'x' [-Wunused-parameter]<br>
void func(int x) = delete;<br>
              ^<br>
2 warnings generated.<br>
<br>
The two warnings seems false positives:<br>
<br>
1) why does it warn about a missing prototype? One can't add a prototype because<br>
he'll get this error:<br>
<br>
error: deleted definition must be first declaration<br>
void func(int x) = delete;<br>
<br>
So, the deleted definition is acting like a prototype itself, doesn't it? I think the warning<br>
is wrong.<br>
<br>
2) Does it make sense to warn about an unused parameter on a deleted definition?<br>
Of course is unused, but it can't be used anyway.<br>
This force the programmer to avoid parameters name, like:<br>
void func(int) = delete;<br>
but this can reduce readability and it seems to me there's no reason to force it.<br>
<br>
Note that these warnings pop up only on free functions. Deleted member functions<br>
don't generate these warnings in these cases.<br>
<br>
Does it make sense to fix these issues?<br>
<br>
This mail is a part of a more general effort of mine to be able to warning-less include<br>
(with -Weverything, more or less) the LLVM headers that I use in my project.<br>
I think (and hope) more will follow.<br>
<br>
Thanks,<br>
Nicola<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>