[PATCH] D33526: Fix spurious Wunused-lambda-capture warning

2017-06-13 Thread Yi Kong via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL305315: Fix spurious Wunused-lambda-capture warning (authored by kongyi). Changed prior to commit: https://reviews.llvm.org/D33526?vs=102099&id=102371#toc Repository: rL LLVM https://reviews.llvm.or

[PATCH] D33526: Fix spurious Wunused-lambda-capture warning

2017-06-13 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons accepted this revision. malcolm.parsons added a comment. This revision is now accepted and ready to land. LGTM! Repository: rL LLVM https://reviews.llvm.org/D33526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lis

[PATCH] D33526: Fix spurious Wunused-lambda-capture warning

2017-06-13 Thread Yi Kong via Phabricator via cfe-commits
kongyi added a comment. For normal captures, variables are safe to eliminate if they are non-ODR used or totally unused. However for init captures, non-ODR usage still depends on the capture; they are only safe to eliminate if totally unused. Repository: rL LLVM https://reviews.llvm.org/D33

[PATCH] D33526: Fix spurious Wunused-lambda-capture warning

2017-06-13 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added a comment. I don't understand why init captures have this problem. The variable is defined within the context of the lambda, but it's not within the context of the templated method. Are you working around a bug somewhere else? Repository: rL LLVM https://reviews.llvm.or

[PATCH] D33526: Fix spurious Wunused-lambda-capture warning

2017-06-09 Thread Yi Kong via Phabricator via cfe-commits
kongyi updated this revision to Diff 102099. Repository: rL LLVM https://reviews.llvm.org/D33526 Files: lib/Sema/SemaLambda.cpp test/SemaCXX/warn-unused-lambda-capture.cpp Index: test/SemaCXX/warn-unused-lambda-capture.cpp =

[PATCH] D33526: Fix spurious Wunused-lambda-capture warning

2017-06-02 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added inline comments. Comment at: lib/Sema/SemaLambda.cpp:1525-1526 + if (!CurContext->isDependentContext() && !IsImplicit) +if ((IsGenericLambda && !From.isNonODRUsed()) || +(!IsGenericLambda && !From.isODRUsed())) + DiagnoseUnu

[PATCH] D33526: Fix spurious Wunused-lambda-capture warning

2017-05-29 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaLambda.cpp:1524-1526 + if (!CurContext->isDependentContext() && !IsImplicit) +if ((IsGenericLambda && !From.isNonODRUsed()) || +(!IsGenericLambda && !From.isODRUsed())) kongyi wrote

[PATCH] D33526: Fix spurious Wunused-lambda-capture warning

2017-05-26 Thread Yi Kong via Phabricator via cfe-commits
kongyi added inline comments. Comment at: lib/Sema/SemaLambda.cpp:1524-1526 + if (!CurContext->isDependentContext() && !IsImplicit) +if ((IsGenericLambda && !From.isNonODRUsed()) || +(!IsGenericLambda && !From.isODRUsed())) malcolm.parson