15b8b8b5dSMarshall Clow //===----------------------------------------------------------------------===//
25b8b8b5dSMarshall Clow //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
65b8b8b5dSMarshall Clow //
75b8b8b5dSMarshall Clow //===----------------------------------------------------------------------===//
85b8b8b5dSMarshall Clow
95b8b8b5dSMarshall Clow // <queue>
10*31cbe0f2SLouis Dionne // UNSUPPORTED: c++03, c++11, c++14
115b8b8b5dSMarshall Clow
125b8b8b5dSMarshall Clow #include <queue>
135b8b8b5dSMarshall Clow #include <list>
145b8b8b5dSMarshall Clow #include <iterator>
155b8b8b5dSMarshall Clow #include <cassert>
165b8b8b5dSMarshall Clow #include <cstddef>
175b8b8b5dSMarshall Clow
185b8b8b5dSMarshall Clow
main(int,char **)192df59c50SJF Bastien int main(int, char**)
205b8b8b5dSMarshall Clow {
215b8b8b5dSMarshall Clow // Test the explicit deduction guides
225b8b8b5dSMarshall Clow {
235b8b8b5dSMarshall Clow // queue(const Container&, const Alloc&);
245b8b8b5dSMarshall Clow // The '45' is not an allocator
255b8b8b5dSMarshall Clow std::queue que(std::list<int>{1,2,3}, 45); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'queue'}}
265b8b8b5dSMarshall Clow }
275b8b8b5dSMarshall Clow
285b8b8b5dSMarshall Clow {
295b8b8b5dSMarshall Clow // queue(const queue&, const Alloc&);
305b8b8b5dSMarshall Clow // The '45' is not an allocator
315b8b8b5dSMarshall Clow std::queue<int> source;
325b8b8b5dSMarshall Clow std::queue que(source, 45); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'queue'}}
335b8b8b5dSMarshall Clow }
345b8b8b5dSMarshall Clow
355b8b8b5dSMarshall Clow // Test the implicit deduction guides
365b8b8b5dSMarshall Clow {
375b8b8b5dSMarshall Clow // queue (allocator &)
385b8b8b5dSMarshall Clow std::queue que((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'queue'}}
395b8b8b5dSMarshall Clow // Note: The extra parens are necessary, since otherwise clang decides it is a function declaration.
405b8b8b5dSMarshall Clow // Also, we can't use {} instead of parens, because that constructs a
415b8b8b5dSMarshall Clow // stack<allocator<int>, allocator<allocator<int>>>
425b8b8b5dSMarshall Clow }
435b8b8b5dSMarshall Clow
442df59c50SJF Bastien
452df59c50SJF Bastien return 0;
465b8b8b5dSMarshall Clow }
47