//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // // class map // template // synth-three-way-result> // operator<=>(const map& x, // const map& y); #include #include "test_allocator.h" int main(int, char**) { // Mismatching allocators { std::map, std::allocator> s1; std::map, test_allocator> s2; // expected-error-re@*:* {{static assertion failed due to requirement {{.+}}Allocator::value_type must be same type as value_type}} s1 <=> s2; // expected-error-re@*:* {{static assertion failed due to requirement {{.+}}Allocator::value_type must be same type as value_type}} s2 <=> s1; } // Mismatching comparision functions { std::map> s1; std::map> s2; // expected-error@+1 {{invalid operands to binary expression}} s1 <=> s2; // expected-error@+1 {{invalid operands to binary expression}} s2 <=> s1; } { std::map> s1; std::map> s2; // expected-error@+1 {{invalid operands to binary expression}} s1 <=> s2; // expected-error@+1 {{invalid operands to binary expression}} s2 <=> s1; } // Mismatching types { std::map s1; std::map s2; // expected-error@+1 {{invalid operands to binary expression}} s1 <=> s2; // expected-error@+1 {{invalid operands to binary expression}} s2 <=> s1; } return 0; }