gcc/testsuite/g++.dg/debug/pr84813.C
raw| 1 | // PR c++/84813 |
| 2 | // { dg-do compile } |
| 3 | // { dg-options "-g -std=c++14" } |
| 4 | |
| 5 | template <typename> |
| 6 | struct P {}; |
| 7 | |
| 8 | template <int> |
| 9 | struct F { |
| 10 | using type = int; |
| 11 | }; |
| 12 | |
| 13 | template <typename T> |
| 14 | void |
| 15 | apply () |
| 16 | { |
| 17 | constexpr int N = T::N; |
| 18 | [] (typename F<N>::type) |
| 19 | { |
| 20 | auto f = [] () {}; |
| 21 | P<decltype (f)>{}; |
| 22 | }; |
| 23 | } |
| 24 | |
| 25 | struct A { |
| 26 | static constexpr int N = 1; |
| 27 | }; |
| 28 | |
| 29 | void |
| 30 | instantiate () |
| 31 | { |
| 32 | apply<A> (); |
| 33 | } |