1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 // Test the use of elaborated-type-specifiers to inject the names of
4 // structs (or classes or unions) into an outer scope as described in
5 // C++ [basic.scope.pdecl]p5.
13 bool test_elab(S1
*s1
, struct S2
*s2
, struct S3
*s3
) {
14 if (s1
->x
== s2
) return true;
15 if (s1
->y
== s3
) return true;
22 void test_elab2(struct S4
*s4
);
25 void X::test_elab2(S4
*s4
) { } // expected-note{{passing argument to parameter 's4' here}}
28 void test_X_elab(NS::X x
) {
30 x
.test_elab2(s4
); // expected-error{{cannot initialize a parameter of type 'NS::S4 *' with an lvalue of type 'struct S4 *'}}
37 void test_S5_scope() {
38 S4
*s4
; // expected-error{{use of undeclared identifier 'S4'}} \
39 // expected-error{{use of undeclared identifier 's4'}}
42 int test_funcparam_scope(struct S5
* s5
) {
43 struct S5
{ int y
; } *s5_2
= 0;
44 if (s5
== s5_2
) return 1; // expected-error {{comparison of distinct pointer types ('struct S5 *' and 'struct S5 *')}}