v.g.vassilev added a comment.
In https://reviews.llvm.org/D29877#766301, @rsmith wrote:
> In https://reviews.llvm.org/D29877#766196, @EricWF wrote:
>
> > No. But I can point you to `range-v3` which uses this pattern and I think
> > the idiom is somewhat appealing, but that's orthogonal to Clang
v.g.vassilev added inline comments.
Comment at: include/clang/Basic/DiagnosticGroups.td:631
// UnusedParameter, (matches GCC's behavior)
+// UnusedTemplate, (clean-up libc++ before enabling)
//
EricWF added inline comments.
Comment at: include/clang/Basic/DiagnosticGroups.td:631
// UnusedParameter, (matches GCC's behavior)
+// UnusedTemplate, (clean-up libc++ before enabling)
//
rsmith added a comment.
In https://reviews.llvm.org/D29877#766196, @EricWF wrote:
> No. But I can point you to `range-v3` which uses this pattern and I think the
> idiom is somewhat appealing, but that's orthogonal to Clang diagnosing it.
I found this:
EricWF added a comment.
In https://reviews.llvm.org/D29877#766196, @EricWF wrote:
> In https://reviews.llvm.org/D29877#766176, @rsmith wrote:
>
> > In https://reviews.llvm.org/D29877#765968, @EricWF wrote:
> >
> > > I think this patch still gets the following case wrong:
> > >
> > > // foo.h
>
EricWF added a comment.
In https://reviews.llvm.org/D29877#766176, @rsmith wrote:
> In https://reviews.llvm.org/D29877#765968, @EricWF wrote:
>
> > I think this patch still gets the following case wrong:
> >
> > // foo.h
> > constexpr struct {
> > template void operator()(T) {} // emits
rsmith added a comment.
In https://reviews.llvm.org/D29877#765968, @EricWF wrote:
> I think this patch still gets the following case wrong:
>
> // foo.h
> constexpr struct {
> template void operator()(T) {} // emits unused template warning
> } foo;
>
What specifically do you think
EricWF added a comment.
I think this patch still gets the following case wrong:
// foo.h
constexpr struct {
template void operator()(T) {} // emits unused template warning
} foo;
https://reviews.llvm.org/D29877
___
cfe-commits mailing
On 11/04/17 22:25, Richard Smith wrote:
On 11 April 2017 at 08:35, Marshall Clow via Phabricator via
cfe-commits > wrote:
mclow.lists added a comment.
Complete reproducer:
// Tested with with: clang++ -std=c++14
v.g.vassilev closed this revision.
v.g.vassilev added a comment.
Relanded in r302518.
https://reviews.llvm.org/D29877
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
v.g.vassilev added a comment.
@rsmith, @mclow.lists, @arphaman, I am planning to reland that soon. Let me
know if you have any objections.
https://reviews.llvm.org/D29877
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
v.g.vassilev updated this revision to Diff 97098.
v.g.vassilev added a comment.
This revision is now accepted and ready to land.
Implement a special diagnostic switch for the warning.
https://reviews.llvm.org/D29877
Files:
include/clang/Basic/DiagnosticGroups.td
v.g.vassilev planned changes to this revision.
v.g.vassilev added a comment.
We agreed to implement a special switch for this, eg. `-Wunused-template`
https://reviews.llvm.org/D29877
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
On 11 April 2017 at 08:35, Marshall Clow via Phabricator via cfe-commits <
cfe-commits@lists.llvm.org> wrote:
> mclow.lists added a comment.
>
> Complete reproducer:
>
> // Tested with with: clang++ -std=c++14 -Wunused-function
> UnusedFVassily.cpp
> //
> // UnusedFVassily.cpp:8:39: warning:
v.g.vassilev added a comment.
Reverted in r299956, due to failures like:
template static int __test(...);
template
auto v = __test<_Tp>(0);
https://reviews.llvm.org/D29877
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
mclow.lists added a comment.
Complete reproducer:
// Tested with with: clang++ -std=c++14 -Wunused-function UnusedFVassily.cpp
//
// UnusedFVassily.cpp:8:39: warning: unused function '__test'
[-Wunused-function]
// template static __two __test(...);
//
v.g.vassilev added a comment.
@mclow.lists, hm... it seems that I cannot reproduce it. It'd really help if
you could paste a standalone reproducer.
https://reviews.llvm.org/D29877
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
v.g.vassilev added a comment.
@chapuni, the LLVM warnings should be fixed in r299947.
@mclow.lists, sorry for not giving heads up :( I am working on the false
positive that you reported.
https://reviews.llvm.org/D29877
___
cfe-commits mailing
mclow.lists added a comment.
The following idiom for detecting member typedefs now throws an warning:
struct __two {char __lx; char __lxx;};
namespace __has_pointer_type_imp
{
template __two __test(...);
template char __test(typename _Up::pointer* = 0);
}
template
On Tue, Apr 11, 2017 at 6:59 AM, Alex Lorenz via Phabricator via
cfe-commits wrote:
> arphaman added a comment.
>
> Ah, I see. I guess if `static` is removed the warning will go away. Thanks!
>
> https://reviews.llvm.org/D29877
>
>
I would have appreciated a heads-up
arphaman added a comment.
Ah, I see. I guess if `static` is removed the warning will go away. Thanks!
https://reviews.llvm.org/D29877
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
v.g.vassilev added a comment.
@arphaman, it seems they are marked as static and this seemed like a bug to
@rsmith.
https://reviews.llvm.org/D29877
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
arphaman added a comment.
The operators in PointerUnion seem useful. I don't think they should be removed
even if they're not used in tree, since they might be used by some out-of-tree
code.
https://reviews.llvm.org/D29877
___
cfe-commits mailing
chapuni added a comment.
I think yes, you may do. Warnings fix may be trivial as far as they are NFC.
It'd be fine that clang tree should be free from warnings with just-built clang.
https://reviews.llvm.org/D29877
___
cfe-commits mailing list
v.g.vassilev added a comment.
Thanks for pinging us. Yeah, I knew them but I was hesitant whether I should
fix them or they should be fixed by the code owners. Shall I commit the fixes?
https://reviews.llvm.org/D29877
___
cfe-commits mailing list
chapuni added a comment.
This brought warnings in llvm tree. Could you take a look, please?
http://bb.pgr.jp/builders/clang-3stage-x86_64-linux/builds/14936 (w/o asserts)
llvm/include/llvm/ADT/PointerUnion.h:193:13: warning: unused function
'operator==' [-Wunused-function]
v.g.vassilev closed this revision.
v.g.vassilev marked 5 inline comments as done.
v.g.vassilev added a comment.
Landed in r299930.
https://reviews.llvm.org/D29877
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.
LGTM with the overloaded operator check removed.
https://reviews.llvm.org/D29877
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
rsmith added inline comments.
Comment at: lib/Sema/Sema.cpp:473
if (const FunctionDecl *FD = dyn_cast(D)) {
+// If this is a function template and neither of its specs is used, warn.
+if (FunctionTemplateDecl *Template = FD->getDescribedFunctionTemplate())
v.g.vassilev updated this revision to Diff 94352.
v.g.vassilev marked an inline comment as done.
v.g.vassilev added a comment.
Improve comment.
https://reviews.llvm.org/D29877
Files:
lib/Sema/Sema.cpp
lib/Sema/SemaDecl.cpp
test/SemaCXX/warn-unused-filescoped.cpp
Index:
v.g.vassilev updated this revision to Diff 94350.
v.g.vassilev added a comment.
Found out which is the right place to avoid the linkage computation issues.
https://reviews.llvm.org/D29877
Files:
lib/Sema/Sema.cpp
lib/Sema/SemaDecl.cpp
test/SemaCXX/warn-unused-filescoped.cpp
Index:
v.g.vassilev added inline comments.
Comment at: lib/Sema/SemaDecl.cpp:1496
return false;
+ // 'static operator' functions are defined in headers; don't warn.
+ if (FD->isOverloadedOperator() &&
rsmith wrote:
> Why? Defining a static operator
v.g.vassilev updated this revision to Diff 94294.
v.g.vassilev added a comment.
Attach the right diff.
https://reviews.llvm.org/D29877
Files:
lib/Sema/Sema.cpp
lib/Sema/SemaDecl.cpp
test/SemaCXX/warn-unused-filescoped.cpp
Index: test/SemaCXX/warn-unused-filescoped.cpp
v.g.vassilev updated this revision to Diff 94293.
v.g.vassilev marked 2 inline comments as done.
v.g.vassilev added a comment.
Iterate over the specs. Diagnose unused variable templates.
https://reviews.llvm.org/D29877
Files:
include/clang/Sema/Sema.h
lib/Sema/Sema.cpp
rsmith added inline comments.
Comment at: lib/Sema/Sema.cpp:472-477
+// If this is a function template, we should remove if it has no
+// specializations.
+if (FunctionTemplateDecl *Template = FD->getDescribedFunctionTemplate()) {
+ if
v.g.vassilev added a comment.
@rsmith ping...
https://reviews.llvm.org/D29877
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
v.g.vassilev updated this revision to Diff 90360.
v.g.vassilev added a comment.
Rebase + ping.
https://reviews.llvm.org/D29877
Files:
lib/Sema/Sema.cpp
lib/Sema/SemaDecl.cpp
test/SemaCXX/warn-unused-filescoped.cpp
Index: test/SemaCXX/warn-unused-filescoped.cpp
v.g.vassilev created this revision.
Repository:
rL LLVM
https://reviews.llvm.org/D29877
Files:
lib/Sema/Sema.cpp
lib/Sema/SemaDecl.cpp
lib/Serialization/ASTReader.cpp
test/SemaCXX/warn-unused-filescoped.cpp
Index: test/SemaCXX/warn-unused-filescoped.cpp
38 matches
Mail list logo