[Sema]. Warn when logical expression is a pointer
which evaluates to true. rdar://18716393.
Reviewed by Richard Trieu
llvm-svn: 222009
diff --git a/clang/test/Sema/exprs.c b/clang/test/Sema/exprs.c
index 2fb17e4..17b1aa2 100644
--- a/clang/test/Sema/exprs.c
+++ b/clang/test/Sema/exprs.c
@@ -244,6 +244,10 @@
if ("help")
(void) 0;
- if (test22)
+ if (test22) // expected-warning {{address of function 'test22' will always evaluate to 'true'}} \
+ // expected-note {{prefix with the address-of operator to silence this warning}}
+ (void) 0;
+
+ if (&test22)
(void) 0;
}