]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/g++.dg/modules/partial-2.h
c++ modules: variable template partial spec fixes [PR107033]
[gcc.git] / gcc / testsuite / g++.dg / modules / partial-2.h
1 template<class T> constexpr bool is_reference_v = false;
2 template<class T> constexpr bool is_reference_v<T&> = true;
3 template<class T> constexpr bool is_reference_v<T&&> = true;
4
5 struct A {
6 template<class T> static constexpr bool is_reference_v = false;
7 };
8
9 template<class T> constexpr bool A::is_reference_v<T&> = true;
10 template<class T> constexpr bool A::is_reference_v<T&&> = true;
11
12 #if __cpp_concepts
13 namespace concepts {
14 template<class T> bool is_reference_v;
15
16 template<class T> requires __is_same(T, T&)
17 constexpr bool is_reference_v<T> = true;
18
19 template<class T> requires __is_same(T, T&&) && (!__is_same(T, T&))
20 constexpr bool is_reference_v<T> = true;
21
22 template<class T> requires (!__is_same(T, T&)) && (!__is_same(T, T&&))
23 constexpr bool is_reference_v<T> = false;
24
25 struct A {
26 template<class T> static bool is_reference_v;
27 };
28
29 template<class T> requires __is_same(T, T&)
30 constexpr bool A::is_reference_v<T> = true;
31
32 template<class T> requires __is_same(T, T&&) && (!__is_same(T, T&))
33 constexpr bool A::is_reference_v<T> = true;
34
35 template<class T> requires (!__is_same(T, T&)) && (!__is_same(T, T&&))
36 constexpr bool A::is_reference_v<T> = false;
37 }
38 #endif
This page took 0.038765 seconds and 5 git commands to generate.