1 // RUN: %clang_cc1 -fexceptions -fcxx-exceptions -Wno-dynamic-exception-spec -verify %std_cxx98- %s
14 typedef struct S1
{ int x
; } S1_typedef
;
16 (void)((struct S2
{ int x
; }*)0); // expected-error{{cannot be defined}}
18 struct S3
{ int x
; } s3
;
20 (void)static_cast<struct S4
{ int x
; } *>(0); // expected-error{{cannot be defined}}
23 struct S5
{ int x
; } f1() { return S5(); } // expected-error{{result type}}
25 void f2(struct S6
{ int x
; } p
); // expected-error{{parameter type}}
28 short foo6 (enum bar0
{qq
} bar3
); // expected-error{{cannot be defined in a parameter type}}
31 void pr19018_1 (enum e19018_1
{qq
} x
); // expected-error{{cannot be defined in a parameter type}}
32 void pr19018_1a (enum e19018_1
{qq
} x
); // expected-error{{cannot be defined in a parameter type}}
35 void pr19018_2 (enum {qq
} x
); // expected-error{{cannot be defined in a parameter type}}
36 void pr19018_3 (struct s19018_2
{int qq
;} x
); // expected-error{{cannot be defined in a parameter type}}
37 void pr19018_4 (struct {int qq
;} x
); // expected-error{{cannot be defined in a parameter type}}
38 void pr19018_5 (struct { void qq(); } x
); // expected-error{{cannot be defined in a parameter type}}
39 void pr19018_5 (struct s19018_2
{ void qq(); } x
); // expected-error{{cannot be defined in a parameter type}}
43 void func1(enum t19018
{qq
} x
); // expected-error{{cannot be defined in a parameter type}}
44 void func2(enum t19018
{qq
} x
); // expected-error{{cannot be defined in a parameter type}}
45 void func3(enum {qq
} x
); // expected-error{{cannot be defined in a parameter type}}
46 void func4(struct t19018
{int qq
;} x
); // expected-error{{cannot be defined in a parameter type}}
47 void func5(struct {int qq
;} x
); // expected-error{{cannot be defined in a parameter type}}
48 void func6(struct { void qq(); } x
); // expected-error{{cannot be defined in a parameter type}}
49 void func7(struct t19018
{ void qq(); } x
); // expected-error{{cannot be defined in a parameter type}}
50 void func8(struct { int qq() { return xx
; }; } x
); // expected-error{{cannot be defined in a parameter type}}
51 void func9(struct t19018
{ int qq() { return xx
; }; } x
); // expected-error{{cannot be defined in a parameter type}}
55 void func1 (enum en_2
{qq
} x
); // expected-error{{cannot be defined in a parameter type}}
57 void func2 (enum en_3
{qq
} x
); // expected-error{{cannot be defined in a parameter type}}
62 short bar5 (struct foo4
{} bar2
); // expected-error{{'foo4' cannot be defined in a parameter type}}
63 long foo5 (float foo6
= foo4
);
66 // expected-error@+2 {{cannot be defined in a parameter type}}
67 // expected-note@+1 {{previous definition is here}}
68 void func_with_eh_and_type(struct type_in_eh
{} o
) throw(int) {}
69 struct type_in_eh
{}; // expected-error {{redefinition of 'type_in_eh'}}