1 // RUN: %clang_cc1 -verify -fsyntax-only -Wstring-conversion %s
4 void assert_error(void);
6 #define assert1(expr) \
12 #define assert2(expr) \
13 ((expr) ? do_nothing() : assert_error())
15 // Exception for common assert form.
19 assert1(0 || "foo"); // expected-warning {{string literal}}
20 assert1("foo"); // expected-warning {{string literal}}
24 assert2(0 || "foo"); // expected-warning {{string literal}}
25 assert2("foo"); // expected-warning {{string literal}}
29 if ("hi") {} // expected-warning {{string literal}}
30 while ("hello") {} // expected-warning {{string literal}}
31 for (;"howdy";) {} // expected-warning {{string literal}}
32 do { } while ("hey"); // expected-warning {{string literal}}
33 int x
= "hey" ? 1 : 2; // expected-warning {{string literal}}