//===----------------------------------------------------------------------===// // // 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 // // template>, // class Allocator = allocator>> // multiset(InputIterator, InputIterator, // Compare = Compare(), Allocator = Allocator()) // -> multiset, Compare, Allocator>; // template, // class Allocator = allocator> // multiset(initializer_list, Compare = Compare(), Allocator = Allocator()) // -> multiset; // template // multiset(InputIterator, InputIterator, Allocator) // -> multiset, // less>, Allocator>; // template // multiset(initializer_list, Allocator) // -> multiset, Allocator>; #include #include #include struct NotAnAllocator { friend bool operator<(NotAnAllocator, NotAnAllocator) { return false; } }; int main(int, char**) { { // cannot deduce Key from nothing std::multiset s; // expected-error-re@-1{{no viable constructor or deduction guide for deduction of template arguments of '{{(std::)?}}multiset'}} } { // cannot deduce Key from just (Compare) std::multiset s(std::less{}); // expected-error-re@-1{{no viable constructor or deduction guide for deduction of template arguments of '{{(std::)?}}multiset'}} } { // cannot deduce Key from just (Compare, Allocator) std::multiset s(std::less{}, std::allocator{}); // expected-error-re@-1{{no viable constructor or deduction guide for deduction of template arguments of '{{(std::)?}}multiset'}} } { // cannot deduce Key from multiset(Allocator) std::multiset s(std::allocator{}); // expected-error-re@-1{{no viable constructor or deduction guide for deduction of template arguments of '{{(std::)?}}multiset'}} } { // since we have parens, not braces, this deliberately does not find the // initializer_list constructor NotAnAllocator a; std::multiset s(a); // expected-error-re@-1{{no viable constructor or deduction guide for deduction of template arguments of '{{(std::)?}}multiset'}} } return 0; }