| 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-exception |
| 6 |
// |
| 7 |
//===----------------------------------------------------------------------===// |
| 8 |
|
| 9 |
// <forward_list> |
| 10 |
// UNSUPPORTED: c++03, c++11, c++14 |
| 11 |
|
| 12 |
// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> |
| 13 |
// forward_list(InputIterator, InputIterator, Allocator = Allocator()) |
| 14 |
// -> forward_list<typename iterator_traits<InputIterator>::value_type, Allocator>; |
| 15 |
// |
| 16 |
|
| 17 |
#include <forward_list> |
| 18 |
#include <iterator> |
| 19 |
#include <cassert> |
| 20 |
#include <cstddef> |
| 21 |
#include <climits> // INT_MAX |
| 22 |
|
| 23 |
struct A {}; |
| 24 |
|
| 25 |
int main(int, char**) |
| 26 |
{ |
| 27 |
// Test the explicit deduction guides |
| 28 |
|
| 29 |
// Test the implicit deduction guides |
| 30 |
{ |
| 31 |
// forward_list (allocator &) |
| 32 |
std::forward_list fwl((std::allocator<int>())); // expected-error-re {{no viable constructor or deduction guide for deduction of template arguments of '{{(std::)?}}forward_list'}} |
| 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 a |
| 35 |
// forward_list<allocator<int>, allocator<allocator<int>>> |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
return 0; |
| 40 |
} |