Suppress all -Wunused-value warnings from macro body expansions.
This is inspired by a number of false positives in real code, including PR14968. I've added test cases reduced from these false positives to test/Sema/unused-expr.c, as well as corresponding test cases that pass the offending expressions as arguments to a no-op macro to ensure that we do warn there. This also removes my previous tweak from r166522/r166534, so that we warn on unused cast expressions in macro arguments. There were several test cases that were using -Wunused-value to test general diagnostic emission features; I changed those to use other warnings or warn on a macro argument expression. I stared at the test case for PR14399 for a while with Richard Smith and we believe the new test case exercises the same codepaths as before. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172696 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- lib/AST/Expr.cpp 0 additions, 4 deletionslib/AST/Expr.cpp
- lib/Sema/SemaStmt.cpp 5 additions, 2 deletionslib/Sema/SemaStmt.cpp
- test/Misc/caret-diags-macros.c 17 additions, 17 deletionstest/Misc/caret-diags-macros.c
- test/Preprocessor/pragma_microsoft.c 3 additions, 2 deletionstest/Preprocessor/pragma_microsoft.c
- test/Sema/unused-expr.c 20 additions, 3 deletionstest/Sema/unused-expr.c
Loading
Please register or sign in to comment