//===----------------------------------------------------------------------===// // // 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++98, c++03, c++11, c++14 // UNSUPPORTED: libcpp-no-deduction-guides // XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0 // template>, // class Pred = equal_to>, // class Allocator = allocator>> // unordered_set(InputIterator, InputIterator, typename see below::size_type = see below, // Hash = Hash(), Pred = Pred(), Allocator = Allocator()) // -> unordered_set, // Hash, Pred, Allocator>; // // template, // class Pred = equal_to, class Allocator = allocator> // unordered_set(initializer_list, typename see below::size_type = see below, // Hash = Hash(), Pred = Pred(), Allocator = Allocator()) // -> unordered_set; // // template // unordered_set(InputIterator, InputIterator, typename see below::size_type, Allocator) // -> unordered_set, // hash>, // equal_to>, // Allocator>; // // template // unordered_set(InputIterator, InputIterator, typename see below::size_type, // Hash, Allocator) // -> unordered_set, Hash, // equal_to>, // Allocator>; // // template // unordered_set(initializer_list, typename see below::size_type, Allocator) // -> unordered_set, equal_to, Allocator>; // // template // unordered_set(initializer_list, typename see below::size_type, Hash, Allocator) // -> unordered_set, Allocator>; #include #include int main(int, char**) { { // cannot deduce Key from nothing std::unordered_set s; // expected-error@-1{{no viable constructor or deduction guide for deduction of template arguments of 'unordered_set'}} } { // cannot deduce Key from just (Size) std::unordered_set s(42); // expected-error@-1{{no viable constructor or deduction guide for deduction of template arguments of 'unordered_set'}} } { // cannot deduce Key from just (Size, Hash) std::unordered_set s(42, std::hash()); // expected-error@-1{{no viable constructor or deduction guide for deduction of template arguments of 'unordered_set'}} } { // cannot deduce Key from just (Size, Hash, Pred) std::unordered_set s(42, std::hash(), std::equal_to<>()); // expected-error@-1{{no viable constructor or deduction guide for deduction of template arguments of 'unordered_set'}} } { // cannot deduce Key from just (Size, Hash, Pred, Allocator) std::unordered_set s(42, std::hash(), std::equal_to<>(), std::allocator()); // expected-error@-1{{no viable constructor or deduction guide for deduction of template arguments of 'unordered_set'}} } { // cannot deduce Key from just (Allocator) std::unordered_set s(std::allocator{}); // expected-error@-1{{no viable constructor or deduction guide for deduction of template arguments of 'unordered_set'}} } { // cannot deduce Key from just (Size, Allocator) std::unordered_set s(42, std::allocator()); // expected-error@-1{{no viable constructor or deduction guide for deduction of template arguments of 'unordered_set'}} } { // cannot deduce Key from just (Size, Hash, Allocator) std::unordered_set s(42, std::hash(), std::allocator()); // expected-error@-1{{no viable constructor or deduction guide for deduction of template arguments of 'unordered_set'}} } return 0; }