1 // RUN: %clang_cc1 -fsyntax-only -verify %s
4 if (sizeof (int){ 1}) {} // sizeof compound literal
5 if (sizeof (int)) {} // sizeof type
8 (void)(int){4}; // compound literal.
10 int A
= (struct{ int a
;}){ 1}.a
;
13 int test2(int a
, int b
) {
14 return a
? (void)a
,b
: a
;
17 int test3(int a
, int b
, int c
) {
26 struct X0
{ struct { struct { int c
[10][9]; } b
; } a
; };
28 int test_offsetof(void) {
29 (void)__builtin_offsetof(struct X0
, a
.b
.c
[4][5]);
33 void test_sizeof(void){
41 int test_leading_extension(void) {
42 __extension__ (*(char*)0) = 1; // expected-warning {{indirection of non-volatile null pointer}} \
43 // expected-note {{consider using __builtin_trap}}
50 return test5( // expected-note {{to match}}
52 ; // expected-error {{expected ')'}}
57 ({} // expected-note {{to match}}
58 ; // expected-error {{expected ')'}}
62 struct pr16992
{ int x
; };
64 void func_16992 (void) {
65 int x1
= sizeof int; // expected-error {{expected parentheses around type name in sizeof expression}}
66 int x2
= sizeof struct pr16992
; // expected-error {{expected parentheses around type name in sizeof expression}}
67 int x3
= __alignof
int; // expected-error {{expected parentheses around type name in __alignof expression}}
68 int x4
= _Alignof
int; // expected-error {{expected parentheses around type name in _Alignof expression}}
71 void callee(double, double);
73 callee(foobar
, // expected-error {{use of undeclared identifier 'foobar'}}
74 fizbin
); // expected-error {{use of undeclared identifier 'fizbin'}}