Clang Project

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