summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/unused-expr-system-header.c
diff options
context:
space:
mode:
authorMatt Beaumont-Gay <matthewbg@google.com>2013-01-12 00:54:16 +0000
committerMatt Beaumont-Gay <matthewbg@google.com>2013-01-12 00:54:16 +0000
commitb1e71a7d0cde313a2515bd2def492001e28ecf79 (patch)
tree683d4f0e5124111e083f0d09fa60a474aaaeac8d /clang/test/Sema/unused-expr-system-header.c
parent37494a176c8bfe274375c1deef124c149ba28150 (diff)
downloadbcm5719-llvm-b1e71a7d0cde313a2515bd2def492001e28ecf79.tar.gz
bcm5719-llvm-b1e71a7d0cde313a2515bd2def492001e28ecf79.zip
Fix -Wunused-comparison for comparisons in arguments to function-like macros.
Previously, -Wunused-comparison ignored comparisons in both macro bodies and macro arguments, but we would still emit a -Wunused-value warning for either. Now we correctly emit -Wunused-comparison for expressions in macro arguments. Also, add isMacroBodyExpansion to SourceManager, to go along with isMacroArgExpansion. llvm-svn: 172279
Diffstat (limited to 'clang/test/Sema/unused-expr-system-header.c')
-rw-r--r--clang/test/Sema/unused-expr-system-header.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/test/Sema/unused-expr-system-header.c b/clang/test/Sema/unused-expr-system-header.c
index dcc8918970c..68c7e9962c5 100644
--- a/clang/test/Sema/unused-expr-system-header.c
+++ b/clang/test/Sema/unused-expr-system-header.c
@@ -3,8 +3,10 @@
void f(int i1, int i2) {
POSSIBLY_BAD_MACRO(5);
STATEMENT_EXPR_MACRO(5);
- COMMA_MACRO_1(i1 == i2, f(i1, i2)); // expected-warning {{expression result unused}}
+ COMMA_MACRO_1(i1 == i2, f(i1, i2)); // expected-warning {{comparison result unused}} \
+ // expected-note {{equality comparison}}
COMMA_MACRO_2(i1 == i2, f(i1, i2));
- COMMA_MACRO_3(i1 == i2, f(i1, i2)); // expected-warning {{expression result unused}}
+ COMMA_MACRO_3(i1 == i2, f(i1, i2)); // expected-warning {{comparison result unused}} \
+ // expected-note {{equality comparison}}
COMMA_MACRO_4(i1 == i2, f(i1, i2));
}
OpenPOWER on IntegriCloud