brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 69768c3 Raw
33 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// UNSUPPORTED: c++03, c++1110// <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