2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2008-08-22 19:38:55 +04:00
|
|
|
|
|
|
|
void f() {
|
|
|
|
float v1 = float(1);
|
|
|
|
int v2 = typeof(int)(1,2); // expected-error {{function-style cast to a builtin type can only take one argument}}
|
|
|
|
typedef int arr[];
|
|
|
|
int v3 = arr(); // expected-error {{array types cannot be value-initialized}}
|
|
|
|
int v4 = int();
|
|
|
|
int v5 = int; // expected-error {{expected '(' for function-style cast or type construction}}
|
2008-08-23 23:24:45 +04:00
|
|
|
typedef int T;
|
|
|
|
int *p;
|
|
|
|
bool v6 = T(0) == p;
|
2008-09-12 04:47:35 +04:00
|
|
|
char *str;
|
2010-02-28 21:30:25 +03:00
|
|
|
str = "a string"; // expected-warning{{conversion from string literal to 'char *' is deprecated}}
|
2008-09-12 04:47:35 +04:00
|
|
|
wchar_t *wstr;
|
2010-02-28 21:30:25 +03:00
|
|
|
wstr = L"a wide string"; // expected-warning{{conversion from string literal to 'wchar_t *' is deprecated}}
|
2008-08-22 19:38:55 +04:00
|
|
|
}
|