instantiate-partial-spec.cpp 696 B

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