PR18560: When switching to a new context, don't just save and restore an
override for the type of 'this', also clear it out (unless we're entering the
context of a lambda-expression, where it should be inherited).
llvm-svn: 199962
diff --git a/clang/test/SemaCXX/member-init.cpp b/clang/test/SemaCXX/member-init.cpp
index 6e4fd5d..d8a00b3 100644
--- a/clang/test/SemaCXX/member-init.cpp
+++ b/clang/test/SemaCXX/member-init.cpp
@@ -100,3 +100,13 @@
};
void f(Sprite& x) { x = x; }
}
+
+namespace PR18560 {
+ struct X { int m; };
+
+ template<typename T = X,
+ typename U = decltype(T::m)>
+ int f();
+
+ struct Y { int b = f(); };
+}