[PATCH] D77611: [Sema] fix -Wunused-result in StmtExpr

2020-04-07 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: clang/lib/Sema/SemaStmt.cpp:252 + // CallExprs below. + if (isa(E) && Loc.isMacroID() && !isa(WarnExpr)) return; sigh, this again produces different from GCC for the kernel. Let me tighten this constrain

[PATCH] D77611: [Sema] fix -Wunused-result in StmtExpr

2020-04-07 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 255808. nickdesaulniers added a comment. - emit warning just for CallExprs Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77611/new/ https://reviews.llvm.org/D77611 Files: clang/lib/Sema/SemaStmt.cpp

[PATCH] D77611: [Sema] fix -Wunused-result in StmtExpr

2020-04-07 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a comment. In D77611#1967488 , @nickdesaulniers wrote: > Note your test case is related to `-Wunused-value`, mine is `-Wunused-result` > (via the use of `__attribute__((warn_result_unused))` which we should always > warn about. Right, b

[PATCH] D77611: [Sema] fix -Wunused-result in StmtExpr

2020-04-07 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. Note your test case is related to `-Wunused-value`, mine is `-Wunused-result` (via the use of `__attribute__((warn_result_unused))` which we should always warn about. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D7

[PATCH] D77611: [Sema] fix -Wunused-result in StmtExpr

2020-04-07 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a comment. In D77611#1965824 , @nickdesaulniers wrote: > ah, using this to build a Linux kernel triggers tons of warnings. So the > behavior of GCC is even more subtle than captured in the test cases here. At least one thing I noticed -

[PATCH] D77611: [Sema] fix -Wunused-result in StmtExpr

2020-04-07 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a comment. (side note: Clang doesn't strive to emulate GCC's warnings bug-for-bug/exactly - certainly about tradeoffs in terms of true and false positives to decide what's appropriate for a clang warning) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:/

[PATCH] D77611: [Sema] fix -Wunused-result in StmtExpr

2020-04-06 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers planned changes to this revision. nickdesaulniers added a comment. ah, using this to build a Linux kernel triggers tons of warnings. So the behavior of GCC is even more subtle than captured in the test cases here. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D77611: [Sema] fix -Wunused-result in StmtExpr

2020-04-06 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers created this revision. nickdesaulniers added a reviewer: dblaikie. Herald added a project: clang. Herald added a subscriber: cfe-commits. nickdesaulniers planned changes to this revision. nickdesaulniers added a comment. ah, using this to build a Linux kernel triggers tons of warni