1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++98 %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++11 %s
7 int v2
= typeof(int)(1,2); // expected-error {{excess elements in scalar initializer}}
9 arr(); // expected-error {{array types cannot be value-initialized}}
11 fn_ty(); // expected-error {{cannot create object of function type 'fn_ty'}}
12 fn_ty(0); // expected-error {{functional-style cast from 'int' to 'fn_ty'}}
13 fn_ty(0, 0); // expected-error {{cannot create object of function type 'fn_ty'}}
14 #if __cplusplus >= 201103L
15 fn_ty
{}; // expected-error {{cannot create object of function type 'fn_ty'}}
16 fn_ty
{0}; // expected-error {{cannot create object of function type 'fn_ty'}}
17 fn_ty
{0, 0}; // expected-error {{cannot create object of function type 'fn_ty'}}
18 fn_ty({}); // expected-error {{cannot create object of function type 'fn_ty'}}
21 int v5
= int; // expected-error {{expected '(' for function-style cast or type construction}}
25 #if __cplusplus >= 201103L
26 // expected-error@-2 {{comparison between pointer and integer ('T' (aka 'int') and 'int *')}}
30 #if __cplusplus <= 199711L
31 // expected-warning@-2 {{conversion from string literal to 'char *' is deprecated}}
33 // expected-warning@-4 {{ISO C++11 does not allow conversion from string literal to 'char *'}}
36 wstr
= L
"a wide string";
37 #if __cplusplus <= 199711L
38 // expected-warning@-2 {{conversion from string literal to 'wchar_t *' is deprecated}}
40 // expected-warning@-4 {{ISO C++11 does not allow conversion from string literal to 'wchar_t *'}}