Fix crash-on-invalid: only use TransformAddressOfOperand when transforming the
operand of a unary address-of expression, not for *all* expressions!
llvm-svn: 182436
diff --git a/clang/test/SemaTemplate/instantiate-expr-5.cpp b/clang/test/SemaTemplate/instantiate-expr-5.cpp
index 13b7eae..c42c2a9 100644
--- a/clang/test/SemaTemplate/instantiate-expr-5.cpp
+++ b/clang/test/SemaTemplate/instantiate-expr-5.cpp
@@ -36,3 +36,13 @@
template void test_anon_union<int>();
}
+
+namespace AddrOfClassMember {
+ template <typename T> struct S {
+ int n;
+ static void f() {
+ +T::n; // expected-error {{invalid use of member}}
+ }
+ };
+ void g() { S<S<int> >::f(); } // expected-note {{in instantiation of}}
+}