1// RUN: %clang_cc1 -fsyntax-only -verify %s
2// expected-no-diagnostics
3
4template <class T> struct A {
5  static T cond;
6
7  template <class U> struct B {
8    static T twice(U value) {
9      return (cond ? value + value : value);
10    }
11  };
12};
13extern template bool A<bool>::cond;
14
15int foo() {
16  A<bool>::cond = true;
17  return A<bool>::B<int>::twice(4);
18}
19
20namespace PR6376 {
21  template<typename T>
22  struct X {
23    template<typename Y>
24    struct Y1 { }; //
25  };
26
27  template<>
28  struct X<float> {
29    template<typename Y>
30    struct Y1 { };
31  };
32
33  template<typename T, typename U>
34  struct Z : public X<T>::template Y1<U> { };
35
36  Z<float, int> z0;
37}
38