Perform lvalue-to-rvalue conversions on __builtin_offsetof array argument index
before typechecking, as suggested by John.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142308 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/offsetof.cpp b/test/SemaCXX/offsetof.cpp
index 17cee62..a5f5d34 100644
--- a/test/SemaCXX/offsetof.cpp
+++ b/test/SemaCXX/offsetof.cpp
@@ -66,3 +66,10 @@
 };
 
 int anonstruct[__builtin_offsetof(bar, x) == 0 ? 1 : -1];
+
+struct LtoRCheck {
+  int a[10];
+  int f();
+};
+int ltor = __builtin_offsetof(struct LtoRCheck, a[LtoRCheck().f]); // \
+  expected-error {{reference to non-static member function must be called}}