xref: /aosp_15_r20/external/clang/test/SemaCXX/member-expr-anonymous-union.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 %s -fsyntax-only -verify
2*67e74705SXin Li // expected-no-diagnostics
3*67e74705SXin Li // PR5543
4*67e74705SXin Li 
5*67e74705SXin Li struct A { int x; union { int* y; float* z; }; }; struct B : A {int a;};
a(B * x)6*67e74705SXin Li int* a(B* x) { return x->y; }
7*67e74705SXin Li 
f()8*67e74705SXin Li struct x { union { int y; }; }; x y; template <int X> int f() { return X+y.y; }
g()9*67e74705SXin Li int g() { return f<2>(); }
10*67e74705SXin Li 
11