Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp1y/lambda-generic-const4.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/81525 |
2 // { dg-do run { target c++14 } } | |
3 | |
4 template <int i> struct A { | |
5 constexpr operator int () const { return i; } | |
6 }; | |
7 template <int i> constexpr A<i> a = {}; | |
8 | |
9 template <typename F> void foo (F f) { | |
10 f (A<0>{}); | |
11 } | |
12 template <typename T> | |
13 void bar (T) { | |
14 constexpr auto N = a<1>; | |
15 auto f = [&] (auto i) { | |
16 if (static_cast<int>(N) != 1) __builtin_abort(); | |
17 }; | |
18 foo (f); | |
19 } | |
20 int main () { bar (0); } |