Debian Codegraph @

gcc/testsuite/g++.dg/concepts/var-templ1.C

raw
1 // PR c++/67117
2 // { dg-do compile { target c++17 } }
3 // { dg-options "-fconcepts" }
4
5 template <class T>
6 requires false
7 constexpr bool v = true;
8
9 template <class T>
10 constexpr bool f() { return true; }
11
12 template <class T>
13 requires v<T>
14 constexpr bool f() { return false; }
15
16 static_assert(f<void>());
17 static_assert(v<void>); // { dg-error "invalid" }