Make sure to call PerformObjectMemberConversion where necessary.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90555 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/member-expr-anonymous-union.cpp b/test/SemaCXX/member-expr-anonymous-union.cpp
new file mode 100644
index 0000000..9566df4
--- /dev/null
+++ b/test/SemaCXX/member-expr-anonymous-union.cpp
@@ -0,0 +1,9 @@
+// RUN: clang-cc %s -fsyntax-only -verify
+// PR5543
+
+struct A { int x; union { int* y; float& z; }; }; struct B : A {int a;};
+int* a(B* x) { return x->y; }
+
+struct x { union { int y; }; }; x y; template <int X> int f() { return X+y.y; }
+int g() { return f<2>(); }
+
diff --git a/test/SemaCXX/offsetof.cpp b/test/SemaCXX/offsetof.cpp
index f0290e8..e18987f 100644
--- a/test/SemaCXX/offsetof.cpp
+++ b/test/SemaCXX/offsetof.cpp
@@ -13,3 +13,6 @@
   int i = __builtin_offsetof(P, fieldThatPointsToANonPODType.m); // expected-warning{{offset of on non-POD type 'struct P'}}
 }
 
+struct Base { int x; };
+struct Derived : Base { int y; };
+int o = __builtin_offsetof(Derived, x); // expected-warning{{offset of on non-POD type}}