1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // UNSUPPORTED: c++03
11 
12 // Before GCC 6, aggregate initialization kicks in.
13 // See https://stackoverflow.com/q/41799015/627587.
14 // UNSUPPORTED: gcc-5
15 
16 // struct nothrow_t {
17 //   explicit nothrow_t() = default;
18 // };
19 // extern const nothrow_t nothrow;
20 
21 // This test checks for LWG 2510.
22 
23 #include <new>
24 
25 
f()26 std::nothrow_t f() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
27 
main(int,char **)28 int main(int, char**) {
29     return 0;
30 }
31