]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/20_util/is_constructible/51185.cc
9a2df1e731e5f69d140d8232fa08dc60c26bcca2
1 // { dg-do compile { target c++11 } }
3 // Copyright (C) 2011-2023 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
20 #include <type_traits>
24 #if __cpp_aggregate_bases && __cpp_aggregate_paren_init
25 // A user-declared constructor prevents B from being an aggregate.
26 // Otherwise 'B&& b{A{}};' becomes valid in C++17 (__cpp_aggregate_bases),
27 // and 'B&& b(A{});' becomes valid in C++17 (__cpp_aggregate_paren_init).
35 static_assert(!std::is_constructible
<B
&&, A
>(), "");
36 static_assert(!std::is_constructible
<B
const &&, A
>(), "");
37 static_assert(!std::is_constructible
<B
const &&, A
const>(), "");
38 static_assert(!std::is_constructible
<B
volatile &&, A
>(), "");
39 static_assert(!std::is_constructible
<B
volatile &&, A
volatile>(), "");
40 static_assert(!std::is_constructible
<B
const volatile &&, A
>(), "");
41 static_assert(!std::is_constructible
<B
const volatile &&, A
const>(), "");
42 static_assert(!std::is_constructible
<B
const volatile &&, A
volatile>(), "");
43 static_assert(!std::is_constructible
<B
const volatile &&,
44 A
const volatile>(), "");