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// UNSUPPORTED: c++03, c++11
10// <experimental/type_traits>
11//
12// struct nonesuch;
13// nonesuch has no default constructor (C++17 section 15.1)
14// or initializer-list constructor (C++17 section 11.6.4),
15// and is not an aggregate (C++17 section 11.6.1).
16
17
18#include <experimental/type_traits>
19#include <string>
20
21#include "test_macros.h"
22
23namespace ex = std::experimental;
24
25void doSomething (const ex::nonesuch &) {}
26
27int main(int, char**) {
28 ex::nonesuch *e0 = new ex::nonesuch; // expected-error {{no matching constructor for initialization of 'ex::nonesuch'}}
29 doSomething({}); // expected-error{{no matching function for call to 'doSomething'}}
30
31 return 0;
32}
33

source code of libcxx/test/std/experimental/utilities/meta/meta.detect/nonesuch.verify.cpp