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++98, c++03
10 
11 // Before GCC 6, aggregate initialization kicks in.
12 // See https://stackoverflow.com/q/41799015/627587.
13 // UNSUPPORTED: gcc-5
14 
15 // <utility>
16 
17 // struct piecewise_construct_t { explicit piecewise_construct_t() = default; };
18 // constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
19 
20 // This test checks for LWG 2510.
21 
22 #include <utility>
23 
24 
25 std::piecewise_construct_t f() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
26 
27 int main(int, char**) {
28     return 0;
29 }
30