annotate gcc/testsuite/g++.dg/cpp2a/concepts-pr86269.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
1 // { dg-do compile { target c++2a } }
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
2 // { dg-additional-options "-fconcepts-ts" }
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
3 #include <type_traits>
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
4
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
5 template<typename t2, typename t = std::remove_reference_t<t2>>
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
6 concept bool IntegralOrIntegralRef = std::is_integral_v<t>;
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
7
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
8 template<IntegralOrIntegralRef t>
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
9 auto foo(t && v)
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
10 {
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
11 return v;
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
12 }
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
13
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
14 int main()
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
15 {
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
16 int i = 7;
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
17 foo(8);
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
18 return foo(i);
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
19 }