When template substitution into a template parameter reduces the level
of that parameter, reduce the level by the number of active template
argument lists rather than by 1. The number of active template
argument lists is only > 1 when we have a class template partial
specialization of a member template of a class template that itself is
a member template of another class template.
... and Boost.MSM does this. Fixes PR7669.
llvm-svn: 112551
diff --git a/clang/test/SemaTemplate/instantiate-member-template.cpp b/clang/test/SemaTemplate/instantiate-member-template.cpp
index 24a3f31..8f4063b 100644
--- a/clang/test/SemaTemplate/instantiate-member-template.cpp
+++ b/clang/test/SemaTemplate/instantiate-member-template.cpp
@@ -189,3 +189,17 @@
};
}
+
+namespace PR7669 {
+ template<class> struct X {
+ template<class> struct Y {
+ template<int,class> struct Z;
+ template<int Dummy> struct Z<Dummy,int> {};
+ };
+ };
+
+ void a()
+ {
+ X<int>::Y<int>::Z<0,int>();
+ }
+}