1*10b55fc8SRichard Smith // RUN: %clang_cc1 -std=c++1y -verify %s
2*10b55fc8SRichard Smith // expected-no-diagnostics
3*10b55fc8SRichard Smith 
4*10b55fc8SRichard Smith template<typename T> struct A {
5*10b55fc8SRichard Smith   template<typename U> struct B;
6*10b55fc8SRichard Smith   template<typename U> struct B<U*>;
7*10b55fc8SRichard Smith };
8*10b55fc8SRichard Smith template<typename T> template<typename U> struct A<T>::B<U*> {};
9*10b55fc8SRichard Smith template struct A<int>;
10*10b55fc8SRichard Smith A<int>::B<int*> b;
11*10b55fc8SRichard Smith 
12*10b55fc8SRichard Smith 
13*10b55fc8SRichard Smith template<typename T> struct B {
14*10b55fc8SRichard Smith   template<typename U> static const int var1;
15*10b55fc8SRichard Smith   template<typename U> static const int var1<U*>;
16*10b55fc8SRichard Smith 
17*10b55fc8SRichard Smith   template<typename U> static const int var2;
18*10b55fc8SRichard Smith };
19*10b55fc8SRichard Smith template<typename T> template<typename U> const int B<T>::var1<U*> = 1;
20*10b55fc8SRichard Smith template<typename T> template<typename U> const int B<T>::var2<U*> = 1;
21*10b55fc8SRichard Smith template struct B<int>;
22*10b55fc8SRichard Smith int b_test1[B<int>::var1<int*>];
23*10b55fc8SRichard Smith int b_test2[B<int>::var2<int*>];
24