blob: 479af21476be6984b7b6ba8e2c0969c13293ebda [file] [log] [blame]
Douglas Gregor53afad52011-07-29 01:08:54 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Argyrios Kyrtzidis987a14b2008-08-22 15:38:55 +00002
3void f() {
4 float v1 = float(1);
Douglas Gregor19311e72010-09-08 21:40:08 +00005 int v2 = typeof(int)(1,2); // expected-error {{excess elements in scalar initializer}}
Argyrios Kyrtzidis987a14b2008-08-22 15:38:55 +00006 typedef int arr[];
7 int v3 = arr(); // expected-error {{array types cannot be value-initialized}}
8 int v4 = int();
9 int v5 = int; // expected-error {{expected '(' for function-style cast or type construction}}
Argyrios Kyrtzidis2fba1212008-08-23 19:24:45 +000010 typedef int T;
11 int *p;
12 bool v6 = T(0) == p;
Douglas Gregor77a52232008-09-12 00:47:35 +000013 char *str;
Douglas Gregora9bff302010-02-28 18:30:25 +000014 str = "a string"; // expected-warning{{conversion from string literal to 'char *' is deprecated}}
Douglas Gregor77a52232008-09-12 00:47:35 +000015 wchar_t *wstr;
Douglas Gregora9bff302010-02-28 18:30:25 +000016 wstr = L"a wide string"; // expected-warning{{conversion from string literal to 'wchar_t *' is deprecated}}
Argyrios Kyrtzidis987a14b2008-08-22 15:38:55 +000017}