summaryrefslogtreecommitdiffstats
path: root/test/CXX/temp/temp.res/temp.dep/temp.dep.type/p1.cpp
blob: 1d1d350cf337a7426133c5f94e9f90e68b7add2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s 

// Examples from CWG1056.
namespace Example1 {
  template<class T> struct A;
  template<class T> using B = A<T>;

  template<class T> struct A {
    struct C {};
    B<T>::C bc; // ok, B<T> is the current instantiation.
  };

  template<class T> struct A<A<T>> {
    struct C {};
    B<B<T>>::C bc; // ok, B<B<T>> is the current instantiation.
  };

  template<class T> struct A<A<A<T>>> {
    struct C {};
    B<B<T>>::C bc; // expected-error {{missing 'typename'}}
  };
}

namespace Example2 {
  template<class T> struct A {
    void g();
  };
  template<class T> using B = A<T>;
  template<class T> void B<T>::g() {} // ok.
}
OpenPOWER on IntegriCloud