1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
5 template<typename T
, int N
>
7 const char *f0(bool Cond
) {
8 return Cond
? "honk" : N
;
9 #if __cplusplus >= 201103L
10 // expected-error@-2 {{incompatible operand types ('const char *' and 'int')}}
12 // expected-no-diagnostics
16 const char *f1(bool Cond
) {
17 return Cond
? N
: "honk";
18 #if __cplusplus >= 201103L
19 // expected-error@-2 {{incompatible operand types ('int' and 'const char *')}}
23 bool f2(const char *str
) {
25 #if __cplusplus >= 201103L
26 // expected-error@-2 {{comparison between pointer and integer ('const char *' and 'int')}}
32 template<unsigned I
> int f0() {
33 return __builtin_choose_expr(I
, 0, 1);
39 template <typename T
> void f(T
*t
)
41 (void)static_cast<void*>(static_cast<A
*>(t
));