Debian Codegraph @

gcc/testsuite/g++.dg/cpp1y/var-templ71.C

raw
1 // PR c++/108550
2 // { dg-do compile { target c++14 } }
3
4 template<class T, T T1>
5 struct integral_constant
6 {
7 static constexpr T value = T1;
8 };
9
10 template <typename T>
11 struct S {
12 template <typename U, typename V>
13 static constexpr void foo(V) { }
14
15 constexpr bool bar () const { foo<int>(10); return false; }
16 };
17
18 template <class Tp>
19 constexpr auto is_pointer_v = S<Tp>{}.bar();
20
21 template <class Tp, int = 0>
22 integral_constant<bool, is_pointer_v<int>> Wrap1();
23
24 int main() {
25 static_assert(!decltype(Wrap1<int>())::value, "");
26 }