summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-alias1.C
blob: 08c38e6f84c6e0fd9fcd8da6298c07fe180c468b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// PR c++/105518
// { dg-do compile { target c++11 } }

struct integral_constant {
  constexpr operator int() const { return 42; }
};

template<int N>
struct A {
  using type = A;
  static constexpr int value = N;
};

template<class T>
void f(T t) {
  using alias = A<t>;
  [](int) {
    typename alias::type a; // { dg-bogus "'t' is not captured" }
    return a.value;
  }(0);
}

template void f(integral_constant);