Daily bump.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp2a / explicit18.C
blobc8916fa4743b183618cd971d36b3175992554478
1 // PR c++/100065
2 // { dg-do compile { target c++20 } }
4 template<bool B>
5 struct bool_constant {
6   static constexpr bool value = B;
7   constexpr operator bool() const { return value; }
8 };
10 using true_type = bool_constant<true>;
11 using false_type = bool_constant<false>;
13 template<bool>
14 struct X {
15     template<typename T>
16     X(T);
19 template<bool b>
20 explicit(b) X(bool_constant<b>) -> X<b>;
22 X false_ = false_type{}; // OK
23 X true_  = true_type{};  // { dg-error "explicit deduction guide" }