summaryrefslogtreecommitdiffstats
path: root/test/SemaTemplate/instantiate-local-class.cpp
blob: 768eb2170a155cc111a976fbace192d3782745cc (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
31
32
33
34
// RUN: %clang_cc1 -verify %s
template<typename T>
void f0() {
  struct X;
  typedef struct Y {
    T (X::* f1())(int) { return 0; }
  } Y2;

  Y2 y = Y();
}

template void f0<int>();

// PR5764
namespace PR5764 {
  class X {
    template <typename T>
    void Bar() {
      typedef T ValueType;
      class Y {
        Y() { V = ValueType(); }

        ValueType V;
      };

      Y y;
    }
  };

  void test(X x) {
    x.Bar<int>();
  }
}

OpenPOWER on IntegriCloud