Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/concepts-pr86269.C

raw
1 // { dg-do compile { target c++20 } }
2 // { dg-additional-options "-fconcepts" }
3 #include <type_traits>
4
5 template<typename t2, typename t = std::remove_reference_t<t2>>
6 concept IntegralOrIntegralRef = std::is_integral_v<t>;
7
8 template<IntegralOrIntegralRef t>
9 auto foo(t && v)
10 {
11 return v;
12 }
13
14 int main()
15 {
16 int i = 7;
17 foo(8);
18 return foo(i);
19 }