@@ -21,7 +21,6 @@ void test() {
2121 using member_func_ptr = decltype (&C::f);
2222 using member_ptr = decltype (&C::member);
2323 using func_ptr = decltype (&ff);
24- using func_t = decltype (ff);
2524
2625 struct R {
2726 int * begin () const { return nullptr ; };
@@ -30,7 +29,6 @@ void test() {
3029 operator int () const { return 0 ; }
3130 operator int *() const { return nullptr ; }
3231 operator func_ptr () const { return nullptr ; }
33- operator void () const {}
3432 operator member_func_ptr () const { return nullptr ; }
3533 operator member_ptr () const { return nullptr ; }
3634 operator color () const { return color::red; }
@@ -49,31 +47,25 @@ void test() {
4947 std::ranges::to<
5048 func_ptr>()); // expected-error-re@*:* {{static assertion failed{{.*}}The target must be a class type}}
5149
52- (void )std::ranges::to<void >(
53- R{}); // expected-error-re@*:* {{static assertion failed{{.*}}The target must be a class type}}
54- (void )(R{} | std::ranges::to<
55- void >()); // expected-error-re@*:* {{static assertion failed{{.*}}The target must be a class type}}
5650 (void )std::ranges::to<member_ptr>(
5751 R{}); // expected-error-re@*:* {{static assertion failed{{.*}}The target must be a class type}}
5852 (void )(R{} |
5953 std::ranges::to<
6054 member_ptr>()); // expected-error-re@*:* {{static assertion failed{{.*}}The target must be a class type}}
61- (void )std::ranges::to<member_func_ptr>(
55+
56+ (void )std::ranges::to<func_t >(
6257 R{}); // expected-error-re@*:* {{static assertion failed{{.*}}The target must be a class type}}
63- (void )(R{} |
64- std::ranges::to<
65- member_func_ptr>()); // expected-error-re@*:* {{static assertion failed{{.*}}The target must be a class type}}
66- (void )std::ranges::to<func_ptr >(
58+ (void )(R{} | std::ranges::to<
59+ func_t >()); // expected-error-re@*:* {{static assertion failed{{.*}}The target must be a class type}}
60+
61+ (void )std::ranges::to<void >(
6762 R{}); // expected-error-re@*:* {{static assertion failed{{.*}}The target must be a class type}}
68- (void )(R{} |
69- std::ranges::to<
70- func_ptr>()); // expected-error-re@*:* {{static assertion failed{{.*}}The target must be a class type}}
63+ (void )(R{} | std::ranges::to<
64+ void >()); // expected-error-re@*:* {{static assertion failed{{.*}}The target must be a class type}}
65+ // expected-error-re@*:* {{static assertion failed{{.*}}ranges::to: unable to convert to the given container type.}}
66+
7167 (void )std::ranges::to<color>(
7268 R{}); // expected-error-re@*:* {{static assertion failed{{.*}}The target must be a class type}}
7369 (void )(R{} | std::ranges::to<
7470 color>()); // expected-error-re@*:* {{static assertion failed{{.*}}The target must be a class type}}
75- (void )std::ranges::to<func_t >(
76- R{}); // expected-error-re@*:* {{static assertion failed{{.*}}The target must be a class type}}
77- (void )(R{} | std::ranges::to<
78- func_t >()); // expected-error-re@*:* {{static assertion failed{{.*}}The target must be a class type}}
7971}
0 commit comments