xref: /llvm-project/libcxx/test/std/concepts/concepts.lang/concept.common/common_with.compile.pass.cpp (revision 5dfdac74cadd9483a66eb17e51dc632b554cccb1)
124dd2d2fSChristopher Di Bella //===----------------------------------------------------------------------===//
224dd2d2fSChristopher Di Bella //
324dd2d2fSChristopher Di Bella // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
424dd2d2fSChristopher Di Bella // See https://llvm.org/LICENSE.txt for license information.
524dd2d2fSChristopher Di Bella // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
624dd2d2fSChristopher Di Bella //
724dd2d2fSChristopher Di Bella //===----------------------------------------------------------------------===//
824dd2d2fSChristopher Di Bella 
924dd2d2fSChristopher Di Bella // UNSUPPORTED: c++03, c++11, c++14, c++17
1024dd2d2fSChristopher Di Bella 
1124dd2d2fSChristopher Di Bella // template<class From, class To>
1224dd2d2fSChristopher Di Bella // concept common_with;
1324dd2d2fSChristopher Di Bella 
1424dd2d2fSChristopher Di Bella #include <concepts>
153d2d3b3eSArthur O'Dwyer #include <type_traits>
1624dd2d2fSChristopher Di Bella 
175d3ab6a2SMark de Wever #include "test_macros.h"
185d3ab6a2SMark de Wever 
1924dd2d2fSChristopher Di Bella template <class T, class U>
2024dd2d2fSChristopher Di Bella constexpr bool CheckCommonWith() noexcept {
2124dd2d2fSChristopher Di Bella   constexpr bool result = std::common_with<T, U>;
2224dd2d2fSChristopher Di Bella   static_assert(std::common_with<T, U&> == result);
2324dd2d2fSChristopher Di Bella   static_assert(std::common_with<T, const U&> == result);
2424dd2d2fSChristopher Di Bella   static_assert(std::common_with<T, volatile U&> == result);
2524dd2d2fSChristopher Di Bella   static_assert(std::common_with<T, const volatile U&> == result);
2624dd2d2fSChristopher Di Bella   static_assert(std::common_with<T, U&&> == result);
2724dd2d2fSChristopher Di Bella   static_assert(std::common_with<T, const U&&> == result);
2824dd2d2fSChristopher Di Bella   static_assert(std::common_with<T, volatile U&&> == result);
2924dd2d2fSChristopher Di Bella   static_assert(std::common_with<T, const volatile U&&> == result);
3024dd2d2fSChristopher Di Bella   static_assert(std::common_with<T&, U&&> == result);
3124dd2d2fSChristopher Di Bella   static_assert(std::common_with<T&, const U&&> == result);
3224dd2d2fSChristopher Di Bella   static_assert(std::common_with<T&, volatile U&&> == result);
3324dd2d2fSChristopher Di Bella   static_assert(std::common_with<T&, const volatile U&&> == result);
3424dd2d2fSChristopher Di Bella   static_assert(std::common_with<const T&, U&&> == result);
3524dd2d2fSChristopher Di Bella   static_assert(std::common_with<const T&, const U&&> == result);
3624dd2d2fSChristopher Di Bella   static_assert(std::common_with<const T&, volatile U&&> == result);
3724dd2d2fSChristopher Di Bella   static_assert(std::common_with<const T&, const volatile U&&> == result);
3824dd2d2fSChristopher Di Bella   static_assert(std::common_with<volatile T&, U&&> == result);
3924dd2d2fSChristopher Di Bella   static_assert(std::common_with<volatile T&, const U&&> == result);
4024dd2d2fSChristopher Di Bella   static_assert(std::common_with<volatile T&, volatile U&&> == result);
4124dd2d2fSChristopher Di Bella   static_assert(std::common_with<volatile T&, const volatile U&&> == result);
4224dd2d2fSChristopher Di Bella   static_assert(std::common_with<const volatile T&, U&&> == result);
4324dd2d2fSChristopher Di Bella   static_assert(std::common_with<const volatile T&, const U&&> == result);
4424dd2d2fSChristopher Di Bella   static_assert(std::common_with<const volatile T&, volatile U&&> == result);
4524dd2d2fSChristopher Di Bella   static_assert(std::common_with<const volatile T&, const volatile U&&> ==
4624dd2d2fSChristopher Di Bella                 result);
4724dd2d2fSChristopher Di Bella   return result;
4824dd2d2fSChristopher Di Bella }
4924dd2d2fSChristopher Di Bella 
5024dd2d2fSChristopher Di Bella template <class T, class U>
5124dd2d2fSChristopher Di Bella constexpr bool HasValidCommonType() noexcept {
5224dd2d2fSChristopher Di Bella   return requires { typename std::common_type_t<T, U>; }
5324dd2d2fSChristopher Di Bella   &&std::same_as<std::common_type_t<T, U>, std::common_type_t<U, T> >;
5424dd2d2fSChristopher Di Bella }
5524dd2d2fSChristopher Di Bella 
5624dd2d2fSChristopher Di Bella namespace BuiltinTypes {
5724dd2d2fSChristopher Di Bella // fundamental types
5824dd2d2fSChristopher Di Bella static_assert(std::common_with<void, void>);
5924dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int, int>());
6024dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int, long>());
6124dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int, unsigned char>());
628f972cb0SMark de Wever #ifndef TEST_HAS_NO_INT128
6324dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int, __int128_t>());
6424dd2d2fSChristopher Di Bella #endif
6524dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int, double>());
6624dd2d2fSChristopher Di Bella 
6724dd2d2fSChristopher Di Bella // arrays
6824dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int[5], int[5]>());
6924dd2d2fSChristopher Di Bella 
7024dd2d2fSChristopher Di Bella // pointers
7124dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int*, int*>());
7224dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int*, const int*>());
7324dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int*, volatile int*>());
7424dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int*, const volatile int*>());
7524dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<const int*, const int*>());
7624dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<const int*, volatile int*>());
7724dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<const int*, const volatile int*>());
7824dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<volatile int*, const int*>());
7924dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<volatile int*, volatile int*>());
8024dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<volatile int*, const volatile int*>());
8124dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<const volatile int*, const int*>());
8224dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<const volatile int*, volatile int*>());
8324dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<const volatile int*, const volatile int*>());
8424dd2d2fSChristopher Di Bella 
8524dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int (*)(), int (*)()>());
8624dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int (*)(), int (*)() noexcept>());
8724dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int (&)(), int (&)()>());
8824dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int (&)(), int (&)() noexcept>());
8924dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int (&)(), int (*)()>());
9024dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int (&)(), int (*)() noexcept>());
9124dd2d2fSChristopher Di Bella 
9224dd2d2fSChristopher Di Bella struct S {};
9324dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int S::*, int S::*>());
9424dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int S::*, const int S::*>());
9524dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int (S::*)(), int (S::*)()>());
9624dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int (S::*)(), int (S::*)() noexcept>());
9724dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int (S::*)() const, int (S::*)() const>());
9824dd2d2fSChristopher Di Bella static_assert(
9924dd2d2fSChristopher Di Bella     CheckCommonWith<int (S::*)() const, int (S::*)() const noexcept>());
10024dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int (S::*)() volatile, int (S::*)() volatile>());
10124dd2d2fSChristopher Di Bella static_assert(
10224dd2d2fSChristopher Di Bella     CheckCommonWith<int (S::*)() volatile, int (S::*)() volatile noexcept>());
10324dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int (S::*)() const volatile,
10424dd2d2fSChristopher Di Bella                               int (S::*)() const volatile>());
10524dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<int (S::*)() const volatile,
10624dd2d2fSChristopher Di Bella                               int (S::*)() const volatile noexcept>());
10724dd2d2fSChristopher Di Bella 
10824dd2d2fSChristopher Di Bella // nonsense
10924dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<double, float*>());
11024dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<int, int[5]>());
11124dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<int*, long*>());
11224dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<int*, unsigned int*>());
11324dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<int (*)(), int (*)(int)>());
11424dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<int S::*, float S::*>());
11524dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<int (S::*)(), int (S::*)() const>());
11624dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<int (S::*)(), int (S::*)() volatile>());
11724dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<int (S::*)(), int (S::*)() const volatile>());
11824dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<int (S::*)() const, int (S::*)() volatile>());
11924dd2d2fSChristopher Di Bella static_assert(
12024dd2d2fSChristopher Di Bella     !CheckCommonWith<int (S::*)() const, int (S::*)() const volatile>());
12124dd2d2fSChristopher Di Bella static_assert(
12224dd2d2fSChristopher Di Bella     !CheckCommonWith<int (S::*)() volatile, int (S::*)() const volatile>());
12324dd2d2fSChristopher Di Bella } // namespace BuiltinTypes
12424dd2d2fSChristopher Di Bella 
12524dd2d2fSChristopher Di Bella namespace NoDefaultCommonType {
12624dd2d2fSChristopher Di Bella class T {};
12724dd2d2fSChristopher Di Bella 
12824dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T, int>());
12924dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<int, T>());
13024dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T, int[10]>());
13124dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T[10], int>());
13224dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T*, int*>());
13324dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T*, const int*>());
13424dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T*, volatile int*>());
13524dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T*, const volatile int*>());
13624dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T*, int*>());
13724dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T*, int*>());
13824dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T*, int*>());
13924dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T*, const int*>());
14024dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T*, volatile int*>());
14124dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T*, const volatile int*>());
14224dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T*, const int*>());
14324dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T*, const int*>());
14424dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T*, const int*>());
14524dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T*, const int*>());
14624dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T*, volatile int*>());
14724dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T*, const volatile int*>());
14824dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T*, volatile int*>());
14924dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T*, volatile int*>());
15024dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T*, volatile int*>());
15124dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T*, const int*>());
15224dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T*, volatile int*>());
15324dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T*, const volatile int*>());
15424dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T*, const volatile int*>());
15524dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T*, const volatile int*>());
15624dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T*, const volatile int*>());
15724dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T&, int&>());
15824dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T&, const int&>());
15924dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T&, volatile int&>());
16024dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T&, const volatile int&>());
16124dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&, int&>());
16224dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&, int&>());
16324dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&, int&>());
16424dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&, const int&>());
16524dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&, volatile int&>());
16624dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&, const volatile int&>());
16724dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&, const int&>());
16824dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&, const int&>());
16924dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&, const int&>());
17024dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&, const int&>());
17124dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&, volatile int&>());
17224dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&, const volatile int&>());
17324dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&, volatile int&>());
17424dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&, volatile int&>());
17524dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&, volatile int&>());
17624dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&, const int&>());
17724dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&, volatile int&>());
17824dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&, const volatile int&>());
17924dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&, const volatile int&>());
18024dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&, const volatile int&>());
18124dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&, const volatile int&>());
18224dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T&, int&&>());
18324dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T&, const int&&>());
18424dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T&, volatile int&&>());
18524dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T&, const volatile int&&>());
18624dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&, int&&>());
18724dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&, int&&>());
18824dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&, int&&>());
18924dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&, const int&&>());
19024dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&, volatile int&&>());
19124dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&, const volatile int&&>());
19224dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&, const int&&>());
19324dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&, const int&&>());
19424dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&, const int&&>());
19524dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&, const int&&>());
19624dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&, volatile int&&>());
19724dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&, const volatile int&&>());
19824dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&, volatile int&&>());
19924dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&, volatile int&&>());
20024dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&, volatile int&&>());
20124dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&, const int&&>());
20224dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&, volatile int&&>());
20324dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&, const volatile int&&>());
20424dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&, const volatile int&&>());
20524dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&, const volatile int&&>());
20624dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&, const volatile int&&>());
20724dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T&&, int&>());
20824dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T&&, const int&>());
20924dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T&&, volatile int&>());
21024dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T&&, const volatile int&>());
21124dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&&, int&>());
21224dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&&, int&>());
21324dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&&, int&>());
21424dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&&, const int&>());
21524dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&&, volatile int&>());
21624dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&&, const volatile int&>());
21724dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&&, const int&>());
21824dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&&, const int&>());
21924dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&&, const int&>());
22024dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&&, const int&>());
22124dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&&, volatile int&>());
22224dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&&, const volatile int&>());
22324dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&&, volatile int&>());
22424dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&&, volatile int&>());
22524dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&&, volatile int&>());
22624dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&&, const int&>());
22724dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&&, volatile int&>());
22824dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&&, const volatile int&>());
22924dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&&, const volatile int&>());
23024dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&&, const volatile int&>());
23124dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&&, const volatile int&>());
23224dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T&&, int&&>());
23324dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T&&, const int&&>());
23424dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T&&, volatile int&&>());
23524dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T&&, const volatile int&&>());
23624dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&&, int&&>());
23724dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&&, int&&>());
23824dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&&, int&&>());
23924dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&&, const int&&>());
24024dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&&, volatile int&&>());
24124dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&&, const volatile int&&>());
24224dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&&, const int&&>());
24324dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&&, const int&&>());
24424dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&&, const int&&>());
24524dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&&, const int&&>());
24624dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&&, volatile int&&>());
24724dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&&, const volatile int&&>());
24824dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&&, volatile int&&>());
24924dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&&, volatile int&&>());
25024dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&&, volatile int&&>());
25124dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&&, const int&&>());
25224dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&&, volatile int&&>());
25324dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&&, const volatile int&&>());
25424dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const T&&, const volatile int&&>());
25524dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<volatile T&&, const volatile int&&>());
25624dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<const volatile T&&, const volatile int&&>());
25724dd2d2fSChristopher Di Bella } // namespace NoDefaultCommonType
25824dd2d2fSChristopher Di Bella 
25924dd2d2fSChristopher Di Bella struct BadBasicCommonType {
26024dd2d2fSChristopher Di Bella   // This test is ill-formed, NDR. If it ever blows up in our faces: that's a good thing.
26124dd2d2fSChristopher Di Bella   // In the meantime, the test should be included. If compiler support is added, then an include guard
26224dd2d2fSChristopher Di Bella   // should be placed so the test doesn't get deleted.
26324dd2d2fSChristopher Di Bella };
26424dd2d2fSChristopher Di Bella 
26524dd2d2fSChristopher Di Bella template <>
266*5dfdac74SNikolas Klauser struct std::common_type<BadBasicCommonType, int> {
26724dd2d2fSChristopher Di Bella   using type = BadBasicCommonType;
26824dd2d2fSChristopher Di Bella };
26924dd2d2fSChristopher Di Bella 
27024dd2d2fSChristopher Di Bella template <>
271*5dfdac74SNikolas Klauser struct std::common_type<int, BadBasicCommonType> {
27224dd2d2fSChristopher Di Bella   using type = int;
27324dd2d2fSChristopher Di Bella };
274*5dfdac74SNikolas Klauser 
27524dd2d2fSChristopher Di Bella static_assert(requires {
27624dd2d2fSChristopher Di Bella   typename std::common_type_t<BadBasicCommonType, int>;
27724dd2d2fSChristopher Di Bella });
27824dd2d2fSChristopher Di Bella static_assert(requires {
27924dd2d2fSChristopher Di Bella   typename std::common_type_t<int, BadBasicCommonType>;
28024dd2d2fSChristopher Di Bella });
28124dd2d2fSChristopher Di Bella static_assert(!std::same_as<std::common_type_t<BadBasicCommonType, int>,
28224dd2d2fSChristopher Di Bella                             std::common_type_t<int, BadBasicCommonType> >);
28324dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<BadBasicCommonType, int>());
28424dd2d2fSChristopher Di Bella 
28524dd2d2fSChristopher Di Bella struct DullCommonType {};
28624dd2d2fSChristopher Di Bella static_assert(!std::convertible_to<DullCommonType, int>);
28724dd2d2fSChristopher Di Bella 
28824dd2d2fSChristopher Di Bella struct T1 {};
28924dd2d2fSChristopher Di Bella static_assert(!std::convertible_to<DullCommonType, T1>);
29024dd2d2fSChristopher Di Bella 
29124dd2d2fSChristopher Di Bella template <>
292*5dfdac74SNikolas Klauser struct std::common_type<T1, int> {
29324dd2d2fSChristopher Di Bella   using type = DullCommonType;
29424dd2d2fSChristopher Di Bella };
29524dd2d2fSChristopher Di Bella 
29624dd2d2fSChristopher Di Bella template <>
297*5dfdac74SNikolas Klauser struct std::common_type<int, T1> {
29824dd2d2fSChristopher Di Bella   using type = DullCommonType;
29924dd2d2fSChristopher Di Bella };
300*5dfdac74SNikolas Klauser 
30124dd2d2fSChristopher Di Bella static_assert(HasValidCommonType<T1, int>());
30224dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T1, int>());
30324dd2d2fSChristopher Di Bella 
30424dd2d2fSChristopher Di Bella struct CommonTypeImplicitlyConstructibleFromInt {
30524dd2d2fSChristopher Di Bella   explicit(false) CommonTypeImplicitlyConstructibleFromInt(int);
30624dd2d2fSChristopher Di Bella };
30724dd2d2fSChristopher Di Bella static_assert(requires {
30824dd2d2fSChristopher Di Bella   static_cast<CommonTypeImplicitlyConstructibleFromInt>(0);
30924dd2d2fSChristopher Di Bella });
31024dd2d2fSChristopher Di Bella 
31124dd2d2fSChristopher Di Bella struct T2 {};
31224dd2d2fSChristopher Di Bella static_assert(
31324dd2d2fSChristopher Di Bella     !std::convertible_to<CommonTypeImplicitlyConstructibleFromInt, T2>);
31424dd2d2fSChristopher Di Bella 
31524dd2d2fSChristopher Di Bella template <>
316*5dfdac74SNikolas Klauser struct std::common_type<T2, int> {
31724dd2d2fSChristopher Di Bella   using type = CommonTypeImplicitlyConstructibleFromInt;
31824dd2d2fSChristopher Di Bella };
31924dd2d2fSChristopher Di Bella 
32024dd2d2fSChristopher Di Bella template <>
321*5dfdac74SNikolas Klauser struct std::common_type<int, T2> {
32224dd2d2fSChristopher Di Bella   using type = CommonTypeImplicitlyConstructibleFromInt;
32324dd2d2fSChristopher Di Bella };
324*5dfdac74SNikolas Klauser 
32524dd2d2fSChristopher Di Bella static_assert(HasValidCommonType<T2, int>());
32624dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T2, int>());
32724dd2d2fSChristopher Di Bella 
32824dd2d2fSChristopher Di Bella struct CommonTypeExplicitlyConstructibleFromInt {
32924dd2d2fSChristopher Di Bella   explicit CommonTypeExplicitlyConstructibleFromInt(int);
33024dd2d2fSChristopher Di Bella };
33124dd2d2fSChristopher Di Bella static_assert(requires {
33224dd2d2fSChristopher Di Bella   static_cast<CommonTypeExplicitlyConstructibleFromInt>(0);
33324dd2d2fSChristopher Di Bella });
33424dd2d2fSChristopher Di Bella 
33524dd2d2fSChristopher Di Bella struct T3 {};
33624dd2d2fSChristopher Di Bella static_assert(
33724dd2d2fSChristopher Di Bella     !std::convertible_to<CommonTypeExplicitlyConstructibleFromInt, T2>);
33824dd2d2fSChristopher Di Bella 
33924dd2d2fSChristopher Di Bella template <>
340*5dfdac74SNikolas Klauser struct std::common_type<T3, int> {
34124dd2d2fSChristopher Di Bella   using type = CommonTypeExplicitlyConstructibleFromInt;
34224dd2d2fSChristopher Di Bella };
34324dd2d2fSChristopher Di Bella 
34424dd2d2fSChristopher Di Bella template <>
345*5dfdac74SNikolas Klauser struct std::common_type<int, T3> {
34624dd2d2fSChristopher Di Bella   using type = CommonTypeExplicitlyConstructibleFromInt;
34724dd2d2fSChristopher Di Bella };
348*5dfdac74SNikolas Klauser 
34924dd2d2fSChristopher Di Bella static_assert(HasValidCommonType<T3, int>());
35024dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T3, int>());
35124dd2d2fSChristopher Di Bella 
35224dd2d2fSChristopher Di Bella struct T4 {};
35324dd2d2fSChristopher Di Bella struct CommonTypeImplicitlyConstructibleFromT4 {
35424dd2d2fSChristopher Di Bella   explicit(false) CommonTypeImplicitlyConstructibleFromT4(T4);
35524dd2d2fSChristopher Di Bella };
35624dd2d2fSChristopher Di Bella static_assert(requires(T4 t4) {
35724dd2d2fSChristopher Di Bella   static_cast<CommonTypeImplicitlyConstructibleFromT4>(t4);
35824dd2d2fSChristopher Di Bella });
35924dd2d2fSChristopher Di Bella 
36024dd2d2fSChristopher Di Bella template <>
361*5dfdac74SNikolas Klauser struct std::common_type<T4, int> {
36224dd2d2fSChristopher Di Bella   using type = CommonTypeImplicitlyConstructibleFromT4;
36324dd2d2fSChristopher Di Bella };
36424dd2d2fSChristopher Di Bella 
36524dd2d2fSChristopher Di Bella template <>
366*5dfdac74SNikolas Klauser struct std::common_type<int, T4> {
36724dd2d2fSChristopher Di Bella   using type = CommonTypeImplicitlyConstructibleFromT4;
36824dd2d2fSChristopher Di Bella };
369*5dfdac74SNikolas Klauser 
37024dd2d2fSChristopher Di Bella static_assert(HasValidCommonType<T4, int>());
37124dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T4, int>());
37224dd2d2fSChristopher Di Bella 
37324dd2d2fSChristopher Di Bella struct T5 {};
37424dd2d2fSChristopher Di Bella struct CommonTypeExplicitlyConstructibleFromT5 {
37524dd2d2fSChristopher Di Bella   explicit CommonTypeExplicitlyConstructibleFromT5(T5);
37624dd2d2fSChristopher Di Bella };
37724dd2d2fSChristopher Di Bella static_assert(requires(T5 t5) {
37824dd2d2fSChristopher Di Bella   static_cast<CommonTypeExplicitlyConstructibleFromT5>(t5);
37924dd2d2fSChristopher Di Bella });
38024dd2d2fSChristopher Di Bella 
38124dd2d2fSChristopher Di Bella template <>
382*5dfdac74SNikolas Klauser struct std::common_type<T5, int> {
38324dd2d2fSChristopher Di Bella   using type = CommonTypeExplicitlyConstructibleFromT5;
38424dd2d2fSChristopher Di Bella };
38524dd2d2fSChristopher Di Bella 
38624dd2d2fSChristopher Di Bella template <>
387*5dfdac74SNikolas Klauser struct std::common_type<int, T5> {
38824dd2d2fSChristopher Di Bella   using type = CommonTypeExplicitlyConstructibleFromT5;
38924dd2d2fSChristopher Di Bella };
390*5dfdac74SNikolas Klauser 
39124dd2d2fSChristopher Di Bella static_assert(HasValidCommonType<T5, int>());
39224dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T5, int>());
39324dd2d2fSChristopher Di Bella 
39424dd2d2fSChristopher Di Bella struct T6 {};
39524dd2d2fSChristopher Di Bella struct CommonTypeNoCommonReference {
39624dd2d2fSChristopher Di Bella   CommonTypeNoCommonReference(T6);
39724dd2d2fSChristopher Di Bella   CommonTypeNoCommonReference(int);
39824dd2d2fSChristopher Di Bella };
39924dd2d2fSChristopher Di Bella 
40024dd2d2fSChristopher Di Bella template <>
401*5dfdac74SNikolas Klauser struct std::common_type<T6, int> {
40224dd2d2fSChristopher Di Bella   using type = CommonTypeNoCommonReference;
40324dd2d2fSChristopher Di Bella };
40424dd2d2fSChristopher Di Bella 
40524dd2d2fSChristopher Di Bella template <>
406*5dfdac74SNikolas Klauser struct std::common_type<int, T6> {
40724dd2d2fSChristopher Di Bella   using type = CommonTypeNoCommonReference;
40824dd2d2fSChristopher Di Bella };
40924dd2d2fSChristopher Di Bella 
41024dd2d2fSChristopher Di Bella template <>
411*5dfdac74SNikolas Klauser struct std::common_type<T6&, int&> {};
41224dd2d2fSChristopher Di Bella 
41324dd2d2fSChristopher Di Bella template <>
414*5dfdac74SNikolas Klauser struct std::common_type<int&, T6&> {};
41524dd2d2fSChristopher Di Bella 
41624dd2d2fSChristopher Di Bella template <>
417*5dfdac74SNikolas Klauser struct std::common_type<T6&, const int&> {};
41824dd2d2fSChristopher Di Bella 
41924dd2d2fSChristopher Di Bella template <>
420*5dfdac74SNikolas Klauser struct std::common_type<int&, const T6&> {};
42124dd2d2fSChristopher Di Bella 
42224dd2d2fSChristopher Di Bella template <>
423*5dfdac74SNikolas Klauser struct std::common_type<T6&, volatile int&> {};
42424dd2d2fSChristopher Di Bella 
42524dd2d2fSChristopher Di Bella template <>
426*5dfdac74SNikolas Klauser struct std::common_type<int&, volatile T6&> {};
42724dd2d2fSChristopher Di Bella 
42824dd2d2fSChristopher Di Bella template <>
429*5dfdac74SNikolas Klauser struct std::common_type<T6&, const volatile int&> {};
43024dd2d2fSChristopher Di Bella 
43124dd2d2fSChristopher Di Bella template <>
432*5dfdac74SNikolas Klauser struct std::common_type<int&, const volatile T6&> {};
43324dd2d2fSChristopher Di Bella 
43424dd2d2fSChristopher Di Bella template <>
435*5dfdac74SNikolas Klauser struct std::common_type<const T6&, int&> {};
43624dd2d2fSChristopher Di Bella 
43724dd2d2fSChristopher Di Bella template <>
438*5dfdac74SNikolas Klauser struct std::common_type<const int&, T6&> {};
43924dd2d2fSChristopher Di Bella 
44024dd2d2fSChristopher Di Bella template <>
441*5dfdac74SNikolas Klauser struct std::common_type<const T6&, const int&> {};
44224dd2d2fSChristopher Di Bella 
44324dd2d2fSChristopher Di Bella template <>
444*5dfdac74SNikolas Klauser struct std::common_type<const int&, const T6&> {};
44524dd2d2fSChristopher Di Bella 
44624dd2d2fSChristopher Di Bella template <>
447*5dfdac74SNikolas Klauser struct std::common_type<const T6&, volatile int&> {};
44824dd2d2fSChristopher Di Bella 
44924dd2d2fSChristopher Di Bella template <>
450*5dfdac74SNikolas Klauser struct std::common_type<const int&, volatile T6&> {};
45124dd2d2fSChristopher Di Bella 
45224dd2d2fSChristopher Di Bella template <>
453*5dfdac74SNikolas Klauser struct std::common_type<const T6&, const volatile int&> {};
45424dd2d2fSChristopher Di Bella 
45524dd2d2fSChristopher Di Bella template <>
456*5dfdac74SNikolas Klauser struct std::common_type<const int&, const volatile T6&> {};
45724dd2d2fSChristopher Di Bella 
45824dd2d2fSChristopher Di Bella template <>
459*5dfdac74SNikolas Klauser struct std::common_type<volatile T6&, int&> {};
46024dd2d2fSChristopher Di Bella 
46124dd2d2fSChristopher Di Bella template <>
462*5dfdac74SNikolas Klauser struct std::common_type<volatile int&, T6&> {};
46324dd2d2fSChristopher Di Bella 
46424dd2d2fSChristopher Di Bella template <>
465*5dfdac74SNikolas Klauser struct std::common_type<volatile T6&, const int&> {};
46624dd2d2fSChristopher Di Bella 
46724dd2d2fSChristopher Di Bella template <>
468*5dfdac74SNikolas Klauser struct std::common_type<volatile int&, const T6&> {};
46924dd2d2fSChristopher Di Bella 
47024dd2d2fSChristopher Di Bella template <>
471*5dfdac74SNikolas Klauser struct std::common_type<volatile T6&, volatile int&> {};
47224dd2d2fSChristopher Di Bella 
47324dd2d2fSChristopher Di Bella template <>
474*5dfdac74SNikolas Klauser struct std::common_type<volatile int&, volatile T6&> {};
47524dd2d2fSChristopher Di Bella 
47624dd2d2fSChristopher Di Bella template <>
477*5dfdac74SNikolas Klauser struct std::common_type<volatile T6&, const volatile int&> {};
47824dd2d2fSChristopher Di Bella 
47924dd2d2fSChristopher Di Bella template <>
480*5dfdac74SNikolas Klauser struct std::common_type<volatile int&, const volatile T6&> {};
48124dd2d2fSChristopher Di Bella 
48224dd2d2fSChristopher Di Bella template <>
483*5dfdac74SNikolas Klauser struct std::common_type<const volatile T6&, int&> {};
48424dd2d2fSChristopher Di Bella 
48524dd2d2fSChristopher Di Bella template <>
486*5dfdac74SNikolas Klauser struct std::common_type<const volatile int&, T6&> {};
48724dd2d2fSChristopher Di Bella 
48824dd2d2fSChristopher Di Bella template <>
489*5dfdac74SNikolas Klauser struct std::common_type<const volatile T6&, const int&> {};
49024dd2d2fSChristopher Di Bella 
49124dd2d2fSChristopher Di Bella template <>
492*5dfdac74SNikolas Klauser struct std::common_type<const volatile int&, const T6&> {};
49324dd2d2fSChristopher Di Bella 
49424dd2d2fSChristopher Di Bella template <>
495*5dfdac74SNikolas Klauser struct std::common_type<const volatile T6&, volatile int&> {};
49624dd2d2fSChristopher Di Bella 
49724dd2d2fSChristopher Di Bella template <>
498*5dfdac74SNikolas Klauser struct std::common_type<const volatile int&, volatile T6&> {};
49924dd2d2fSChristopher Di Bella 
50024dd2d2fSChristopher Di Bella template <>
501*5dfdac74SNikolas Klauser struct std::common_type<const volatile T6&, const volatile int&> {};
50224dd2d2fSChristopher Di Bella 
50324dd2d2fSChristopher Di Bella template <>
504*5dfdac74SNikolas Klauser struct std::common_type<const volatile int&, const volatile T6&> {};
50524dd2d2fSChristopher Di Bella 
50624dd2d2fSChristopher Di Bella template <typename T, typename U>
50724dd2d2fSChristopher Di Bella constexpr bool HasCommonReference() noexcept {
50824dd2d2fSChristopher Di Bella   return requires { typename std::common_reference_t<T, U>; };
50924dd2d2fSChristopher Di Bella }
51024dd2d2fSChristopher Di Bella 
51124dd2d2fSChristopher Di Bella static_assert(HasValidCommonType<T6, int>());
51224dd2d2fSChristopher Di Bella static_assert(!HasCommonReference<const T6&, const int&>());
51324dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T6, int>());
51424dd2d2fSChristopher Di Bella 
51524dd2d2fSChristopher Di Bella struct T7 {};
51624dd2d2fSChristopher Di Bella struct CommonTypeNoMetaCommonReference {
51724dd2d2fSChristopher Di Bella   CommonTypeNoMetaCommonReference(T7);
51824dd2d2fSChristopher Di Bella   CommonTypeNoMetaCommonReference(int);
51924dd2d2fSChristopher Di Bella };
52024dd2d2fSChristopher Di Bella 
52124dd2d2fSChristopher Di Bella template <>
522*5dfdac74SNikolas Klauser struct std::common_type<T7, int> {
52324dd2d2fSChristopher Di Bella   using type = CommonTypeNoMetaCommonReference;
52424dd2d2fSChristopher Di Bella };
52524dd2d2fSChristopher Di Bella 
52624dd2d2fSChristopher Di Bella template <>
527*5dfdac74SNikolas Klauser struct std::common_type<int, T7> {
52824dd2d2fSChristopher Di Bella   using type = CommonTypeNoMetaCommonReference;
52924dd2d2fSChristopher Di Bella };
53024dd2d2fSChristopher Di Bella 
53124dd2d2fSChristopher Di Bella template <>
532*5dfdac74SNikolas Klauser struct std::common_type<T7&, int&> {
53324dd2d2fSChristopher Di Bella   using type = void;
53424dd2d2fSChristopher Di Bella };
53524dd2d2fSChristopher Di Bella 
53624dd2d2fSChristopher Di Bella template <>
537*5dfdac74SNikolas Klauser struct std::common_type<int&, T7&> {
53824dd2d2fSChristopher Di Bella   using type = void;
53924dd2d2fSChristopher Di Bella };
54024dd2d2fSChristopher Di Bella 
54124dd2d2fSChristopher Di Bella template <>
542*5dfdac74SNikolas Klauser struct std::common_type<T7&, const int&> {
54324dd2d2fSChristopher Di Bella   using type = void;
54424dd2d2fSChristopher Di Bella };
54524dd2d2fSChristopher Di Bella 
54624dd2d2fSChristopher Di Bella template <>
547*5dfdac74SNikolas Klauser struct std::common_type<int&, const T7&> {
54824dd2d2fSChristopher Di Bella   using type = void;
54924dd2d2fSChristopher Di Bella };
55024dd2d2fSChristopher Di Bella 
55124dd2d2fSChristopher Di Bella template <>
552*5dfdac74SNikolas Klauser struct std::common_type<T7&, volatile int&> {
55324dd2d2fSChristopher Di Bella   using type = void;
55424dd2d2fSChristopher Di Bella };
55524dd2d2fSChristopher Di Bella 
55624dd2d2fSChristopher Di Bella template <>
557*5dfdac74SNikolas Klauser struct std::common_type<int&, volatile T7&> {
55824dd2d2fSChristopher Di Bella   using type = void;
55924dd2d2fSChristopher Di Bella };
56024dd2d2fSChristopher Di Bella 
56124dd2d2fSChristopher Di Bella template <>
562*5dfdac74SNikolas Klauser struct std::common_type<T7&, const volatile int&> {
56324dd2d2fSChristopher Di Bella   using type = void;
56424dd2d2fSChristopher Di Bella };
56524dd2d2fSChristopher Di Bella 
56624dd2d2fSChristopher Di Bella template <>
567*5dfdac74SNikolas Klauser struct std::common_type<int&, const volatile T7&> {
56824dd2d2fSChristopher Di Bella   using type = void;
56924dd2d2fSChristopher Di Bella };
57024dd2d2fSChristopher Di Bella 
57124dd2d2fSChristopher Di Bella template <>
572*5dfdac74SNikolas Klauser struct std::common_type<const T7&, int&> {
57324dd2d2fSChristopher Di Bella   using type = void;
57424dd2d2fSChristopher Di Bella };
57524dd2d2fSChristopher Di Bella 
57624dd2d2fSChristopher Di Bella template <>
577*5dfdac74SNikolas Klauser struct std::common_type<const int&, T7&> {
57824dd2d2fSChristopher Di Bella   using type = void;
57924dd2d2fSChristopher Di Bella };
58024dd2d2fSChristopher Di Bella 
58124dd2d2fSChristopher Di Bella template <>
582*5dfdac74SNikolas Klauser struct std::common_type<const T7&, const int&> {
58324dd2d2fSChristopher Di Bella   using type = void;
58424dd2d2fSChristopher Di Bella };
58524dd2d2fSChristopher Di Bella 
58624dd2d2fSChristopher Di Bella template <>
587*5dfdac74SNikolas Klauser struct std::common_type<const int&, const T7&> {
58824dd2d2fSChristopher Di Bella   using type = void;
58924dd2d2fSChristopher Di Bella };
59024dd2d2fSChristopher Di Bella 
59124dd2d2fSChristopher Di Bella template <>
592*5dfdac74SNikolas Klauser struct std::common_type<const T7&, volatile int&> {
59324dd2d2fSChristopher Di Bella   using type = void;
59424dd2d2fSChristopher Di Bella };
59524dd2d2fSChristopher Di Bella 
59624dd2d2fSChristopher Di Bella template <>
597*5dfdac74SNikolas Klauser struct std::common_type<const int&, volatile T7&> {
59824dd2d2fSChristopher Di Bella   using type = void;
59924dd2d2fSChristopher Di Bella };
60024dd2d2fSChristopher Di Bella 
60124dd2d2fSChristopher Di Bella template <>
602*5dfdac74SNikolas Klauser struct std::common_type<const T7&, const volatile int&> {
60324dd2d2fSChristopher Di Bella   using type = void;
60424dd2d2fSChristopher Di Bella };
60524dd2d2fSChristopher Di Bella 
60624dd2d2fSChristopher Di Bella template <>
607*5dfdac74SNikolas Klauser struct std::common_type<const int&, const volatile T7&> {
60824dd2d2fSChristopher Di Bella   using type = void;
60924dd2d2fSChristopher Di Bella };
61024dd2d2fSChristopher Di Bella 
61124dd2d2fSChristopher Di Bella template <>
612*5dfdac74SNikolas Klauser struct std::common_type<volatile T7&, int&> {
61324dd2d2fSChristopher Di Bella   using type = void;
61424dd2d2fSChristopher Di Bella };
61524dd2d2fSChristopher Di Bella 
61624dd2d2fSChristopher Di Bella template <>
617*5dfdac74SNikolas Klauser struct std::common_type<volatile int&, T7&> {
61824dd2d2fSChristopher Di Bella   using type = void;
61924dd2d2fSChristopher Di Bella };
62024dd2d2fSChristopher Di Bella 
62124dd2d2fSChristopher Di Bella template <>
622*5dfdac74SNikolas Klauser struct std::common_type<volatile T7&, const int&> {
62324dd2d2fSChristopher Di Bella   using type = void;
62424dd2d2fSChristopher Di Bella };
62524dd2d2fSChristopher Di Bella 
62624dd2d2fSChristopher Di Bella template <>
627*5dfdac74SNikolas Klauser struct std::common_type<volatile int&, const T7&> {
62824dd2d2fSChristopher Di Bella   using type = void;
62924dd2d2fSChristopher Di Bella };
63024dd2d2fSChristopher Di Bella 
63124dd2d2fSChristopher Di Bella template <>
632*5dfdac74SNikolas Klauser struct std::common_type<volatile T7&, volatile int&> {
63324dd2d2fSChristopher Di Bella   using type = void;
63424dd2d2fSChristopher Di Bella };
63524dd2d2fSChristopher Di Bella 
63624dd2d2fSChristopher Di Bella template <>
637*5dfdac74SNikolas Klauser struct std::common_type<volatile int&, volatile T7&> {
63824dd2d2fSChristopher Di Bella   using type = void;
63924dd2d2fSChristopher Di Bella };
64024dd2d2fSChristopher Di Bella 
64124dd2d2fSChristopher Di Bella template <>
642*5dfdac74SNikolas Klauser struct std::common_type<volatile T7&, const volatile int&> {
64324dd2d2fSChristopher Di Bella   using type = void;
64424dd2d2fSChristopher Di Bella };
64524dd2d2fSChristopher Di Bella 
64624dd2d2fSChristopher Di Bella template <>
647*5dfdac74SNikolas Klauser struct std::common_type<volatile int&, const volatile T7&> {
64824dd2d2fSChristopher Di Bella   using type = void;
64924dd2d2fSChristopher Di Bella };
65024dd2d2fSChristopher Di Bella 
65124dd2d2fSChristopher Di Bella template <>
652*5dfdac74SNikolas Klauser struct std::common_type<const volatile T7&, int&> {
65324dd2d2fSChristopher Di Bella   using type = void;
65424dd2d2fSChristopher Di Bella };
65524dd2d2fSChristopher Di Bella 
65624dd2d2fSChristopher Di Bella template <>
657*5dfdac74SNikolas Klauser struct std::common_type<const volatile int&, T7&> {
65824dd2d2fSChristopher Di Bella   using type = void;
65924dd2d2fSChristopher Di Bella };
66024dd2d2fSChristopher Di Bella 
66124dd2d2fSChristopher Di Bella template <>
662*5dfdac74SNikolas Klauser struct std::common_type<const volatile T7&, const int&> {
66324dd2d2fSChristopher Di Bella   using type = void;
66424dd2d2fSChristopher Di Bella };
66524dd2d2fSChristopher Di Bella 
66624dd2d2fSChristopher Di Bella template <>
667*5dfdac74SNikolas Klauser struct std::common_type<const volatile int&, const T7&> {
66824dd2d2fSChristopher Di Bella   using type = void;
66924dd2d2fSChristopher Di Bella };
67024dd2d2fSChristopher Di Bella 
67124dd2d2fSChristopher Di Bella template <>
672*5dfdac74SNikolas Klauser struct std::common_type<const volatile T7&, volatile int&> {
67324dd2d2fSChristopher Di Bella   using type = void;
67424dd2d2fSChristopher Di Bella };
67524dd2d2fSChristopher Di Bella 
67624dd2d2fSChristopher Di Bella template <>
677*5dfdac74SNikolas Klauser struct std::common_type<const volatile int&, volatile T7&> {
67824dd2d2fSChristopher Di Bella   using type = void;
67924dd2d2fSChristopher Di Bella };
68024dd2d2fSChristopher Di Bella 
68124dd2d2fSChristopher Di Bella template <>
682*5dfdac74SNikolas Klauser struct std::common_type<const volatile T7&, const volatile int&> {
68324dd2d2fSChristopher Di Bella   using type = void;
68424dd2d2fSChristopher Di Bella };
68524dd2d2fSChristopher Di Bella 
68624dd2d2fSChristopher Di Bella template <>
687*5dfdac74SNikolas Klauser struct std::common_type<const volatile int&, const volatile T7&> {
68824dd2d2fSChristopher Di Bella   using type = void;
68924dd2d2fSChristopher Di Bella };
690*5dfdac74SNikolas Klauser 
69124dd2d2fSChristopher Di Bella static_assert(HasValidCommonType<T7, int>());
69224dd2d2fSChristopher Di Bella static_assert(HasValidCommonType<const T7&, const int&>());
69324dd2d2fSChristopher Di Bella static_assert(HasCommonReference<const T7&, const int&>());
69424dd2d2fSChristopher Di Bella static_assert(
69524dd2d2fSChristopher Di Bella     !HasCommonReference<std::common_type_t<T7, int>&,
69624dd2d2fSChristopher Di Bella                         std::common_reference_t<const T7&, const int&> >());
69724dd2d2fSChristopher Di Bella static_assert(!CheckCommonWith<T7, int>());
69824dd2d2fSChristopher Di Bella 
69924dd2d2fSChristopher Di Bella struct CommonWithInt {
70024dd2d2fSChristopher Di Bella   operator int() const volatile;
70124dd2d2fSChristopher Di Bella };
70224dd2d2fSChristopher Di Bella 
70324dd2d2fSChristopher Di Bella template <>
704*5dfdac74SNikolas Klauser struct std::common_type<CommonWithInt, int> {
70524dd2d2fSChristopher Di Bella   using type = int;
70624dd2d2fSChristopher Di Bella };
70724dd2d2fSChristopher Di Bella 
70824dd2d2fSChristopher Di Bella template <>
709*5dfdac74SNikolas Klauser struct std::common_type<int, CommonWithInt> : std::common_type<CommonWithInt, int> {};
71024dd2d2fSChristopher Di Bella 
71124dd2d2fSChristopher Di Bella template <>
712*5dfdac74SNikolas Klauser struct std::common_type<CommonWithInt&, int&> : std::common_type<CommonWithInt, int> {};
71324dd2d2fSChristopher Di Bella 
71424dd2d2fSChristopher Di Bella template <>
715*5dfdac74SNikolas Klauser struct std::common_type<int&, CommonWithInt&> : std::common_type<CommonWithInt, int> {};
71624dd2d2fSChristopher Di Bella 
71724dd2d2fSChristopher Di Bella template <>
718*5dfdac74SNikolas Klauser struct std::common_type<CommonWithInt&, const int&> : std::common_type<CommonWithInt, int> {};
71924dd2d2fSChristopher Di Bella 
72024dd2d2fSChristopher Di Bella template <>
721*5dfdac74SNikolas Klauser struct std::common_type<int&, const CommonWithInt&> : std::common_type<CommonWithInt, int> {};
72224dd2d2fSChristopher Di Bella 
72324dd2d2fSChristopher Di Bella template <>
724*5dfdac74SNikolas Klauser struct std::common_type<CommonWithInt&, volatile int&> : std::common_type<CommonWithInt, int> {};
72524dd2d2fSChristopher Di Bella 
72624dd2d2fSChristopher Di Bella template <>
727*5dfdac74SNikolas Klauser struct std::common_type<int&, volatile CommonWithInt&> : std::common_type<CommonWithInt, int> {};
72824dd2d2fSChristopher Di Bella 
72924dd2d2fSChristopher Di Bella template <>
730*5dfdac74SNikolas Klauser struct std::common_type<CommonWithInt&, const volatile int&> : std::common_type<CommonWithInt, int> {};
73124dd2d2fSChristopher Di Bella 
73224dd2d2fSChristopher Di Bella template <>
733*5dfdac74SNikolas Klauser struct std::common_type<int&, const volatile CommonWithInt&> : std::common_type<CommonWithInt, int> {};
73424dd2d2fSChristopher Di Bella 
73524dd2d2fSChristopher Di Bella template <>
736*5dfdac74SNikolas Klauser struct std::common_type<const CommonWithInt&, int&> : std::common_type<CommonWithInt, int> {};
73724dd2d2fSChristopher Di Bella 
73824dd2d2fSChristopher Di Bella template <>
739*5dfdac74SNikolas Klauser struct std::common_type<const int&, CommonWithInt&> : std::common_type<CommonWithInt, int> {};
74024dd2d2fSChristopher Di Bella 
74124dd2d2fSChristopher Di Bella template <>
742*5dfdac74SNikolas Klauser struct std::common_type<const CommonWithInt&, const int&> : std::common_type<CommonWithInt, int> {};
74324dd2d2fSChristopher Di Bella 
74424dd2d2fSChristopher Di Bella template <>
745*5dfdac74SNikolas Klauser struct std::common_type<const int&, const CommonWithInt&> : std::common_type<CommonWithInt, int> {};
74624dd2d2fSChristopher Di Bella 
74724dd2d2fSChristopher Di Bella template <>
748*5dfdac74SNikolas Klauser struct std::common_type<const CommonWithInt&, volatile int&> : std::common_type<CommonWithInt, int> {};
74924dd2d2fSChristopher Di Bella 
75024dd2d2fSChristopher Di Bella template <>
751*5dfdac74SNikolas Klauser struct std::common_type<const int&, volatile CommonWithInt&> : std::common_type<CommonWithInt, int> {};
75224dd2d2fSChristopher Di Bella 
75324dd2d2fSChristopher Di Bella template <>
754*5dfdac74SNikolas Klauser struct std::common_type<const CommonWithInt&, const volatile int&> : std::common_type<CommonWithInt, int> {};
75524dd2d2fSChristopher Di Bella 
75624dd2d2fSChristopher Di Bella template <>
757*5dfdac74SNikolas Klauser struct std::common_type<const int&, const volatile CommonWithInt&> : std::common_type<CommonWithInt, int> {};
75824dd2d2fSChristopher Di Bella 
75924dd2d2fSChristopher Di Bella template <>
760*5dfdac74SNikolas Klauser struct std::common_type<volatile CommonWithInt&, int&> : std::common_type<CommonWithInt, int> {};
76124dd2d2fSChristopher Di Bella 
76224dd2d2fSChristopher Di Bella template <>
763*5dfdac74SNikolas Klauser struct std::common_type<volatile int&, CommonWithInt&> : std::common_type<CommonWithInt, int> {};
76424dd2d2fSChristopher Di Bella 
76524dd2d2fSChristopher Di Bella template <>
766*5dfdac74SNikolas Klauser struct std::common_type<volatile CommonWithInt&, const int&> : std::common_type<CommonWithInt, int> {};
76724dd2d2fSChristopher Di Bella 
76824dd2d2fSChristopher Di Bella template <>
769*5dfdac74SNikolas Klauser struct std::common_type<volatile int&, const CommonWithInt&> : std::common_type<CommonWithInt, int> {};
77024dd2d2fSChristopher Di Bella 
77124dd2d2fSChristopher Di Bella template <>
772*5dfdac74SNikolas Klauser struct std::common_type<volatile CommonWithInt&, volatile int&> : std::common_type<CommonWithInt, int> {};
77324dd2d2fSChristopher Di Bella 
77424dd2d2fSChristopher Di Bella template <>
775*5dfdac74SNikolas Klauser struct std::common_type<volatile int&, volatile CommonWithInt&> : std::common_type<CommonWithInt, int> {};
77624dd2d2fSChristopher Di Bella 
77724dd2d2fSChristopher Di Bella template <>
778*5dfdac74SNikolas Klauser struct std::common_type<volatile CommonWithInt&, const volatile int&> : std::common_type<CommonWithInt, int> {};
77924dd2d2fSChristopher Di Bella 
78024dd2d2fSChristopher Di Bella template <>
781*5dfdac74SNikolas Klauser struct std::common_type<volatile int&, const volatile CommonWithInt&> : std::common_type<CommonWithInt, int> {};
78224dd2d2fSChristopher Di Bella 
78324dd2d2fSChristopher Di Bella template <>
784*5dfdac74SNikolas Klauser struct std::common_type<const volatile CommonWithInt&, int&> : std::common_type<CommonWithInt, int> {};
78524dd2d2fSChristopher Di Bella 
78624dd2d2fSChristopher Di Bella template <>
787*5dfdac74SNikolas Klauser struct std::common_type<const volatile int&, CommonWithInt&> : std::common_type<CommonWithInt, int> {};
78824dd2d2fSChristopher Di Bella 
78924dd2d2fSChristopher Di Bella template <>
790*5dfdac74SNikolas Klauser struct std::common_type<const volatile CommonWithInt&, const int&> : std::common_type<CommonWithInt, int> {};
79124dd2d2fSChristopher Di Bella 
79224dd2d2fSChristopher Di Bella template <>
793*5dfdac74SNikolas Klauser struct std::common_type<const volatile int&, const CommonWithInt&> : std::common_type<CommonWithInt, int> {};
79424dd2d2fSChristopher Di Bella 
79524dd2d2fSChristopher Di Bella template <>
796*5dfdac74SNikolas Klauser struct std::common_type<const volatile CommonWithInt&, volatile int&> : std::common_type<CommonWithInt, int> {};
79724dd2d2fSChristopher Di Bella 
79824dd2d2fSChristopher Di Bella template <>
799*5dfdac74SNikolas Klauser struct std::common_type<const volatile int&, volatile CommonWithInt&> : std::common_type<CommonWithInt, int> {};
80024dd2d2fSChristopher Di Bella 
80124dd2d2fSChristopher Di Bella template <>
802*5dfdac74SNikolas Klauser struct std::common_type<const volatile CommonWithInt&, const volatile int&> : std::common_type<CommonWithInt, int> {};
80324dd2d2fSChristopher Di Bella 
80424dd2d2fSChristopher Di Bella template <>
805*5dfdac74SNikolas Klauser struct std::common_type<const volatile int&, const volatile CommonWithInt&> : std::common_type<CommonWithInt, int> {};
806*5dfdac74SNikolas Klauser 
80724dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<CommonWithInt, int>());
80824dd2d2fSChristopher Di Bella 
80924dd2d2fSChristopher Di Bella struct CommonWithIntButRefLong {
81024dd2d2fSChristopher Di Bella   operator int() const volatile;
81124dd2d2fSChristopher Di Bella };
81224dd2d2fSChristopher Di Bella 
81324dd2d2fSChristopher Di Bella template <>
814*5dfdac74SNikolas Klauser struct std::common_type<CommonWithIntButRefLong, int> {
81524dd2d2fSChristopher Di Bella   using type = int;
81624dd2d2fSChristopher Di Bella };
81724dd2d2fSChristopher Di Bella 
81824dd2d2fSChristopher Di Bella template <>
819*5dfdac74SNikolas Klauser struct std::common_type<int, CommonWithIntButRefLong> : std::common_type<CommonWithIntButRefLong, int> {};
82024dd2d2fSChristopher Di Bella 
82124dd2d2fSChristopher Di Bella template <>
822*5dfdac74SNikolas Klauser struct std::common_type<CommonWithIntButRefLong&, int&> {
82324dd2d2fSChristopher Di Bella   using type = long;
82424dd2d2fSChristopher Di Bella };
82524dd2d2fSChristopher Di Bella 
82624dd2d2fSChristopher Di Bella template <>
827*5dfdac74SNikolas Klauser struct std::common_type<int&, CommonWithIntButRefLong&> : std::common_type<CommonWithIntButRefLong&, int&> {};
82824dd2d2fSChristopher Di Bella 
82924dd2d2fSChristopher Di Bella template <>
830*5dfdac74SNikolas Klauser struct std::common_type<CommonWithIntButRefLong&, const int&> : std::common_type<CommonWithIntButRefLong&, int&> {};
83124dd2d2fSChristopher Di Bella 
83224dd2d2fSChristopher Di Bella template <>
833*5dfdac74SNikolas Klauser struct std::common_type<int&, const CommonWithIntButRefLong&> : std::common_type<CommonWithIntButRefLong&, int&> {};
83424dd2d2fSChristopher Di Bella 
83524dd2d2fSChristopher Di Bella template <>
836*5dfdac74SNikolas Klauser struct std::common_type<CommonWithIntButRefLong&, volatile int&> : std::common_type<CommonWithIntButRefLong&, int&> {};
83724dd2d2fSChristopher Di Bella 
83824dd2d2fSChristopher Di Bella template <>
839*5dfdac74SNikolas Klauser struct std::common_type<int&, volatile CommonWithIntButRefLong&> : std::common_type<CommonWithIntButRefLong&, int&> {};
84024dd2d2fSChristopher Di Bella 
84124dd2d2fSChristopher Di Bella template <>
842*5dfdac74SNikolas Klauser struct std::common_type<CommonWithIntButRefLong&, const volatile int&>
843*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
84424dd2d2fSChristopher Di Bella 
84524dd2d2fSChristopher Di Bella template <>
846*5dfdac74SNikolas Klauser struct std::common_type<int&, const volatile CommonWithIntButRefLong&>
847*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
84824dd2d2fSChristopher Di Bella 
84924dd2d2fSChristopher Di Bella template <>
850*5dfdac74SNikolas Klauser struct std::common_type<const CommonWithIntButRefLong&, int&> : std::common_type<CommonWithIntButRefLong&, int&> {};
85124dd2d2fSChristopher Di Bella 
85224dd2d2fSChristopher Di Bella template <>
853*5dfdac74SNikolas Klauser struct std::common_type<const int&, CommonWithIntButRefLong&> : std::common_type<CommonWithIntButRefLong&, int&> {};
85424dd2d2fSChristopher Di Bella 
85524dd2d2fSChristopher Di Bella template <>
856*5dfdac74SNikolas Klauser struct std::common_type<const CommonWithIntButRefLong&, const int&> : std::common_type<CommonWithIntButRefLong&, int&> {
857*5dfdac74SNikolas Klauser };
85824dd2d2fSChristopher Di Bella 
85924dd2d2fSChristopher Di Bella template <>
860*5dfdac74SNikolas Klauser struct std::common_type<const int&, const CommonWithIntButRefLong&> : std::common_type<CommonWithIntButRefLong&, int&> {
861*5dfdac74SNikolas Klauser };
86224dd2d2fSChristopher Di Bella 
86324dd2d2fSChristopher Di Bella template <>
864*5dfdac74SNikolas Klauser struct std::common_type<const CommonWithIntButRefLong&, volatile int&>
865*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
86624dd2d2fSChristopher Di Bella 
86724dd2d2fSChristopher Di Bella template <>
868*5dfdac74SNikolas Klauser struct std::common_type<const int&, volatile CommonWithIntButRefLong&>
869*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
87024dd2d2fSChristopher Di Bella 
87124dd2d2fSChristopher Di Bella template <>
872*5dfdac74SNikolas Klauser struct std::common_type<const CommonWithIntButRefLong&, const volatile int&>
873*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
87424dd2d2fSChristopher Di Bella 
87524dd2d2fSChristopher Di Bella template <>
876*5dfdac74SNikolas Klauser struct std::common_type<const int&, const volatile CommonWithIntButRefLong&>
877*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
87824dd2d2fSChristopher Di Bella 
87924dd2d2fSChristopher Di Bella template <>
880*5dfdac74SNikolas Klauser struct std::common_type<volatile CommonWithIntButRefLong&, int&> : std::common_type<CommonWithIntButRefLong&, int&> {};
88124dd2d2fSChristopher Di Bella 
88224dd2d2fSChristopher Di Bella template <>
883*5dfdac74SNikolas Klauser struct std::common_type<volatile int&, CommonWithIntButRefLong&> : std::common_type<CommonWithIntButRefLong&, int&> {};
88424dd2d2fSChristopher Di Bella 
88524dd2d2fSChristopher Di Bella template <>
886*5dfdac74SNikolas Klauser struct std::common_type<volatile CommonWithIntButRefLong&, const int&>
887*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
88824dd2d2fSChristopher Di Bella 
88924dd2d2fSChristopher Di Bella template <>
890*5dfdac74SNikolas Klauser struct std::common_type<volatile int&, const CommonWithIntButRefLong&>
891*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
89224dd2d2fSChristopher Di Bella 
89324dd2d2fSChristopher Di Bella template <>
894*5dfdac74SNikolas Klauser struct std::common_type<volatile CommonWithIntButRefLong&, volatile int&>
895*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
89624dd2d2fSChristopher Di Bella 
89724dd2d2fSChristopher Di Bella template <>
898*5dfdac74SNikolas Klauser struct std::common_type<volatile int&, volatile CommonWithIntButRefLong&>
899*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
90024dd2d2fSChristopher Di Bella 
90124dd2d2fSChristopher Di Bella template <>
902*5dfdac74SNikolas Klauser struct std::common_type<volatile CommonWithIntButRefLong&, const volatile int&>
903*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
90424dd2d2fSChristopher Di Bella 
90524dd2d2fSChristopher Di Bella template <>
906*5dfdac74SNikolas Klauser struct std::common_type<volatile int&, const volatile CommonWithIntButRefLong&>
907*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
90824dd2d2fSChristopher Di Bella 
90924dd2d2fSChristopher Di Bella template <>
910*5dfdac74SNikolas Klauser struct std::common_type<const volatile CommonWithIntButRefLong&, int&>
911*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
91224dd2d2fSChristopher Di Bella 
91324dd2d2fSChristopher Di Bella template <>
914*5dfdac74SNikolas Klauser struct std::common_type<const volatile int&, CommonWithIntButRefLong&>
915*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
91624dd2d2fSChristopher Di Bella 
91724dd2d2fSChristopher Di Bella template <>
918*5dfdac74SNikolas Klauser struct std::common_type<const volatile CommonWithIntButRefLong&, const int&>
919*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
92024dd2d2fSChristopher Di Bella 
92124dd2d2fSChristopher Di Bella template <>
922*5dfdac74SNikolas Klauser struct std::common_type<const volatile int&, const CommonWithIntButRefLong&>
923*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
92424dd2d2fSChristopher Di Bella 
92524dd2d2fSChristopher Di Bella template <>
926*5dfdac74SNikolas Klauser struct std::common_type<const volatile CommonWithIntButRefLong&, volatile int&>
927*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
92824dd2d2fSChristopher Di Bella 
92924dd2d2fSChristopher Di Bella template <>
930*5dfdac74SNikolas Klauser struct std::common_type<const volatile int&, volatile CommonWithIntButRefLong&>
931*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
93224dd2d2fSChristopher Di Bella 
93324dd2d2fSChristopher Di Bella template <>
934*5dfdac74SNikolas Klauser struct std::common_type<const volatile CommonWithIntButRefLong&, const volatile int&>
935*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
93624dd2d2fSChristopher Di Bella 
93724dd2d2fSChristopher Di Bella template <>
938*5dfdac74SNikolas Klauser struct std::common_type<const volatile int&, const volatile CommonWithIntButRefLong&>
939*5dfdac74SNikolas Klauser     : std::common_type<CommonWithIntButRefLong&, int&> {};
940*5dfdac74SNikolas Klauser 
94124dd2d2fSChristopher Di Bella static_assert(CheckCommonWith<CommonWithIntButRefLong, int>());
942