summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/exprs.c
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-12-04 06:09:13 +0000
committerJohn McCall <rjmccall@apple.com>2010-12-04 06:09:13 +0000
commit29cb2fdbc1fff5ba4978c85dd886231858d0c112 (patch)
tree4b3fb523c4cb53c875ba9571c1a1ce341c5b4a83 /clang/test/Sema/exprs.c
parentbd35f73b6bd91a859d7c0e1b4b0e9719f342e62c (diff)
downloadbcm5719-llvm-29cb2fdbc1fff5ba4978c85dd886231858d0c112.tar.gz
bcm5719-llvm-29cb2fdbc1fff5ba4978c85dd886231858d0c112.zip
When deciding whether to complain about the type of a boolean condition, use
the type of the expression *after* array/function decay. llvm-svn: 120895
Diffstat (limited to 'clang/test/Sema/exprs.c')
-rw-r--r--clang/test/Sema/exprs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Sema/exprs.c b/clang/test/Sema/exprs.c
index d6e17ff6ecc..e88f7fc08bc 100644
--- a/clang/test/Sema/exprs.c
+++ b/clang/test/Sema/exprs.c
@@ -157,3 +157,12 @@ void test21(volatile struct Test21 *ptr) {
(test21_help(), *ptr); // expected-error {{incomplete type 'struct Test21' where a complete type is required}}
(*ptr, test21_help()); // expected-error {{incomplete type 'struct Test21' where a complete type is required}}
}
+
+// Make sure we do function/array decay.
+void test22() {
+ if ("help")
+ (void) 0;
+
+ if (test22)
+ (void) 0;
+}
OpenPOWER on IntegriCloud