blob: 00695612562b19cc9db0b8c81cbdb7f9cfaeb128 [file] [log] [blame]
Argyrios Kyrtzidisf303e8a2009-05-22 23:05:39 +00001// RUN: clang-cc -fsyntax-only -pedantic -verify %s
Argyrios Kyrtzidisf58f45e2009-05-22 10:24:42 +00002
3void f() {
4 typedef int T;
5 int x, *px;
6
7 // Type id.
8 (T())x; // expected-error {{used type 'T (void)'}}
9 (T())+x; // expected-error {{used type 'T (void)'}}
10 (T())*px; // expected-error {{used type 'T (void)'}}
11
12 // Expression.
13 x = (T());
14 x = (T())/x;
Argyrios Kyrtzidisf303e8a2009-05-22 23:05:39 +000015
16 typedef int *PT;
17 // Make sure stuff inside the parens are parsed only once (only one warning).
18 x = (PT()[(int){1}]); // expected-warning {{compound literals}}
Argyrios Kyrtzidisf58f45e2009-05-22 10:24:42 +000019}