Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2014-10-09 Ville Voutilainen <ville.voutilainen@gmail.com>
PR libstdc++/60132 * include/std/type_traits (is_trivially_copyable, is_trivially_constructible, is_trivially_default_constructible, is_trivially_copy_constructible, is_trivially_move_constructible, is_trivially_assignable, is_trivially_copy_assignable, is_trivially_move_assignable): New. * testsuite/20_util/is_trivially_assignable/requirements/ typedefs.cc: Likewise. * testsuite/20_util/is_trivially_assignable/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_trivially_assignable/value.cc: Likewise. * testsuite/20_util/is_trivially_constructible/requirements/ typedefs.cc: Likewise. * testsuite/20_util/is_trivially_constructible/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_trivially_constructible/value.cc: Likewise. * testsuite/20_util/is_trivially_copyable/requirements/ typedefs.cc: Likewise. * testsuite/20_util/is_trivially_copyable/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_trivially_copyable/value.cc: Likewise. * testsuite/20_util/is_trivially_copy_assignable/requirements/ typedefs.cc: Likewise. * testsuite/20_util/is_trivially_copy_assignable/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_trivially_copy_assignable/value.cc: Likewise. * testsuite/20_util/is_trivially_copy_constructible/requirements/ typedefs.cc: Likewise. * testsuite/20_util/is_trivially_copy_constructible/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_trivially_copy_constructible/value.cc: Likewise. * testsuite/20_util/is_trivially_default_constructible/requirements/ typedefs.cc: Likewise. * testsuite/20_util/is_trivially_default_constructible/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_trivially_default_constructible/ value.cc: Likewise. * testsuite/20_util/is_trivially_move_assignable/requirements/ typedefs.cc: Likewise. * testsuite/20_util/is_trivially_move_assignable/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_trivially_move_assignable/value.cc: Likewise. * testsuite/20_util/is_trivially_move_constructible/requirements/ typedefs.cc: Likewise. * testsuite/20_util/is_trivially_move_constructible/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_trivially_move_constructible/value.cc: Likewise. * testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error line number. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216032 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
paolo
committed
Oct 9, 2014
1 parent
61a892d
commit 285dc59
Showing
29 changed files
with
1,469 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...tdc++-v3/testsuite/20_util/is_trivially_assignable/requirements/explicit_instantiation.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// { dg-options "-std=gnu++11" } | ||
// { dg-do compile } | ||
// | ||
// 2014-10-09 Ville Voutilainen <ville.voutilainen@gmail.com> | ||
// | ||
// Copyright (C) 2014 Free Software Foundation, Inc. | ||
// | ||
// This file is part of the GNU ISO C++ Library. This library is free | ||
// software; you can redistribute it and/or modify it under the | ||
// terms of the GNU General Public License as published by the | ||
// Free Software Foundation; either version 3, or (at your option) | ||
// any later version. | ||
|
||
// This library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License along | ||
// with this library; see the file COPYING3. If not see | ||
// <http://www.gnu.org/licenses/>. | ||
|
||
// NB: This file is for testing type_traits with NO OTHER INCLUDES. | ||
|
||
#include <type_traits> | ||
|
||
namespace std | ||
{ | ||
typedef short test_type; | ||
template struct is_trivially_assignable<test_type, test_type>; | ||
} |
37 changes: 37 additions & 0 deletions
37
libstdc++-v3/testsuite/20_util/is_trivially_assignable/requirements/typedefs.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// { dg-options "-std=gnu++11" } | ||
// | ||
// 2014-10-09 Ville Voutilainen <ville.voutilainen@gmail.com> | ||
// | ||
// Copyright (C) 2014 Free Software Foundation, Inc. | ||
// | ||
// This file is part of the GNU ISO C++ Library. This library is free | ||
// software; you can redistribute it and/or modify it under the | ||
// terms of the GNU General Public License as published by the | ||
// Free Software Foundation; either version 3, or (at your option) | ||
// any later version. | ||
// | ||
// This library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License along | ||
// with this library; see the file COPYING3. If not see | ||
// <http://www.gnu.org/licenses/>. | ||
|
||
// | ||
// NB: This file is for testing type_traits with NO OTHER INCLUDES. | ||
|
||
#include <type_traits> | ||
|
||
// { dg-do compile } | ||
|
||
void test01() | ||
{ | ||
// Check for required typedefs | ||
typedef std::is_trivially_assignable<int, int> test_type; | ||
typedef test_type::value_type value_type; | ||
typedef test_type::type type; | ||
typedef test_type::type::value_type type_value_type; | ||
typedef test_type::type::type type_type; | ||
} |
135 changes: 135 additions & 0 deletions
135
libstdc++-v3/testsuite/20_util/is_trivially_assignable/value.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
// { dg-options "-std=gnu++11" } | ||
// { dg-do compile } | ||
// | ||
// 2014-10-09 Ville Voutilainen <ville.voutilainen@gmail.com> | ||
// | ||
// Copyright (C) 2014 Free Software Foundation, Inc. | ||
// | ||
// This file is part of the GNU ISO C++ Library. This library is free | ||
// software; you can redistribute it and/or modify it under the | ||
// terms of the GNU General Public License as published by the | ||
// Free Software Foundation; either version 3, or (at your option) | ||
// any later version. | ||
// | ||
// This library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License along | ||
// with this library; see the file COPYING3. If not see | ||
// <http://www.gnu.org/licenses/>. | ||
|
||
#include <type_traits> | ||
#include <testsuite_tr1.h> | ||
|
||
struct HasTemplateCAssign | ||
{ | ||
HasTemplateCAssign& operator=(const HasTemplateCAssign&) = default; | ||
template <class T> | ||
HasTemplateCAssign& operator=(T&&); | ||
}; | ||
|
||
struct MoveOnly | ||
{ | ||
MoveOnly& operator=(MoveOnly&&) = default; | ||
}; | ||
|
||
struct MoveOnly2 | ||
{ | ||
MoveOnly2& operator=(MoveOnly2&&) = delete; | ||
}; | ||
|
||
void test01() | ||
{ | ||
using std::is_trivially_assignable; | ||
using namespace __gnu_test; | ||
|
||
static_assert(test_property<is_trivially_assignable, | ||
int, int>(false), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
int&, int>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
int&, int&>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
int&, int&&>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
int&, const int&>(true), ""); | ||
|
||
static_assert(test_property<is_trivially_assignable, | ||
TType, TType>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
TType&, TType>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
TType&, TType&>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
TType&, TType&&>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
TType&, const TType&>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
PODType, PODType>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
NType&, NType&>(false), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
SLType, SLType>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
assign::Empty, assign::Empty>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
assign::Abstract, assign::Abstract>(false), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
assign::Ellipsis, assign::Ellipsis>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
assign::DelEllipsis, assign::DelEllipsis>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
assign::Any, assign::Any>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
assign::DelDef, assign::DelDef>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
assign::DelCopy, assign::DelCopy>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
assign::Nontrivial, assign::Nontrivial>(false), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
assign::AnyAssign, assign::AnyAssign>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
assign::DelAnyAssign, assign::DelAnyAssign>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
assign::DelCopyAssign, assign::DelCopyAssign>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
assign::MO, assign::MO>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
assign::MO, assign::MO&&>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
assign::MO, assign::MO&>(false), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
assign::MO, const assign::MO&>(false), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
CopyConsOnlyType, CopyConsOnlyType>(false), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
CopyConsOnlyType, const CopyConsOnlyType&>(false), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
MoveConsOnlyType, MoveConsOnlyType>(false), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
MoveConsOnlyType, MoveConsOnlyType&&>(false), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
HasTemplateCAssign, HasTemplateCAssign>(false), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
HasTemplateCAssign, const HasTemplateCAssign&>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
ClassType, DerivedType>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
ClassType, DerivedType&>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
ClassType, DerivedType&&>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
ClassType, const DerivedType&>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
MoveOnly, MoveOnly>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
MoveOnly, MoveOnly&&>(true), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
MoveOnly, MoveOnly&>(false), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
MoveOnly, const MoveOnly&>(false), ""); | ||
static_assert(test_property<is_trivially_assignable, | ||
MoveOnly2, MoveOnly2>(false), ""); | ||
} |
31 changes: 31 additions & 0 deletions
31
...++-v3/testsuite/20_util/is_trivially_constructible/requirements/explicit_instantiation.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// { dg-options "-std=gnu++11" } | ||
// { dg-do compile } | ||
// | ||
// 2014-10-09 Ville Voutilainen <ville.voutilainen@gmail.com> | ||
// | ||
// Copyright (C) 2014 Free Software Foundation, Inc. | ||
// | ||
// This file is part of the GNU ISO C++ Library. This library is free | ||
// software; you can redistribute it and/or modify it under the | ||
// terms of the GNU General Public License as published by the | ||
// Free Software Foundation; either version 3, or (at your option) | ||
// any later version. | ||
|
||
// This library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License along | ||
// with this library; see the file COPYING3. If not see | ||
// <http://www.gnu.org/licenses/>. | ||
|
||
// NB: This file is for testing type_traits with NO OTHER INCLUDES. | ||
|
||
#include <type_traits> | ||
|
||
namespace std | ||
{ | ||
typedef short test_type; | ||
template struct is_trivially_constructible<test_type>; | ||
} |
Oops, something went wrong.