brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 61e58b0 Raw
40 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// <array>10// UNSUPPORTED: c++03, c++11, c++1411 12// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>13//    deque(InputIterator, InputIterator, Allocator = Allocator())14//    -> deque<typename iterator_traits<InputIterator>::value_type, Allocator>;15//16 17#include <deque>18#include <iterator>19#include <cassert>20#include <cstddef>21#include <climits> // INT_MAX22 23struct A {};24 25int main(int, char**) {26  //  Test the explicit deduction guides27 28  //  Test the implicit deduction guides29  {30    //  deque (allocator &)31    std::deque deq((std::allocator< int>()));32    // expected-error-re@-1 {{no viable constructor or deduction guide for deduction of template arguments of '{{(std::)?}}deque'}}33    //  Note: The extra parens are necessary, since otherwise clang decides it is a function declaration.34    //  Also, we can't use {} instead of parens, because that constructs a35    //      deque<allocator<int>, allocator<allocator<int>>>36  }37 38  return 0;39}40