summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/exprs.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-01-12 23:18:54 +0000
committerDouglas Gregor <dgregor@apple.com>2010-01-12 23:18:54 +0000
commit49862b8285b62d7222bd91e57f7ea953751d4c93 (patch)
treeee84083b229af94ca44f6f6772550b01d50befe2 /clang/test/Sema/exprs.c
parent4b0e352061e10a50928154beccfc043ded9e6b84 (diff)
downloadbcm5719-llvm-49862b8285b62d7222bd91e57f7ea953751d4c93.tar.gz
bcm5719-llvm-49862b8285b62d7222bd91e57f7ea953751d4c93.zip
Don't emit string-comparison or self-comparison warnings in
unevaluated contexts, because they only matter for code that will actually be evaluated at runtime. As part of this, I had to extend PartialDiagnostic to support fix-it hints. llvm-svn: 93266
Diffstat (limited to 'clang/test/Sema/exprs.c')
-rw-r--r--clang/test/Sema/exprs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/test/Sema/exprs.c b/clang/test/Sema/exprs.c
index 9059cac22e5..9acc63fa41a 100644
--- a/clang/test/Sema/exprs.c
+++ b/clang/test/Sema/exprs.c
@@ -87,6 +87,10 @@ int test12(const char *X) {
return X == "foo"; // expected-warning {{comparison against a string literal is unspecified}}
}
+int test12b(const char *X) {
+ return sizeof(X == "foo"); // no-warning
+}
+
// rdar://6719156
void test13(
void (^P)()) { // expected-error {{blocks support disabled - compile with -fblocks}}
OpenPOWER on IntegriCloud