URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/trunk/gnu-stable/gcc-4.5.1/libstdc++-v3/testsuite/tr1/4_metaprogramming
- from Rev 816 to Rev 826
- ↔ Reverse comparison
Rev 816 → Rev 826
/is_same/value.cc
0,0 → 1,49
// 2004-12-08 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.6 Relationships between types |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_same; |
using namespace __gnu_test; |
|
// Positive tests. |
VERIFY( (test_relationship<is_same, int, int>(true)) ); |
VERIFY( (test_relationship<is_same, const int, const int>(true)) ); |
VERIFY( (test_relationship<is_same, int&, int&>(true)) ); |
VERIFY( (test_relationship<is_same, ClassType, ClassType>(true)) ); |
|
// Negative tests. |
VERIFY( (test_relationship<is_same, void, int>(false)) ); |
VERIFY( (test_relationship<is_same, int, const int>(false)) ); |
VERIFY( (test_relationship<is_same, int, int&>(false)) ); |
VERIFY( (test_relationship<is_same, int, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_same/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-08 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_same<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; |
} |
/is_same/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_same<test_type, test_type>; |
} |
} |
/has_trivial_destructor/value.cc
0,0 → 1,57
// 2004-12-26 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2005, 2006, 2007, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::has_trivial_destructor; |
using namespace __gnu_test; |
|
VERIFY( (test_category<has_trivial_destructor, void>(true)) ); |
VERIFY( (test_category<has_trivial_destructor, int>(true)) ); |
VERIFY( (test_category<has_trivial_destructor, float>(true)) ); |
VERIFY( (test_category<has_trivial_destructor, EnumType>(true)) ); |
VERIFY( (test_category<has_trivial_destructor, int*>(true)) ); |
VERIFY( (test_category<has_trivial_destructor, int(*)(int)>(true)) ); |
VERIFY( (test_category<has_trivial_destructor, int (ClassType::*)>(true)) ); |
VERIFY( (test_category<has_trivial_destructor, |
int (ClassType::*) (int)>(true)) ); |
VERIFY( (test_category<has_trivial_destructor, int[2]>(true)) ); |
VERIFY( (test_category<has_trivial_destructor, float[][3]>(true)) ); |
VERIFY( (test_category<has_trivial_destructor, EnumType[2][3][4]>(true)) ); |
VERIFY( (test_category<has_trivial_destructor, int*[3]>(true)) ); |
VERIFY( (test_category<has_trivial_destructor, int(*[][2])(int)>(true)) ); |
VERIFY( (test_category<has_trivial_destructor, |
int (ClassType::*[2][3])>(true)) ); |
VERIFY( (test_category<has_trivial_destructor, |
int (ClassType::*[][2][3]) (int)>(true)) ); |
VERIFY( (test_category<has_trivial_destructor, ClassType>(true)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/has_trivial_destructor/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-26 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::has_trivial_destructor<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; |
} |
/has_trivial_destructor/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct has_trivial_destructor<test_type>; |
} |
} |
/is_union/value.cc
0,0 → 1,60
// 2007-04-08 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2007, 2009 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/>. |
|
// 4.5.1 Primary type categories |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_union; |
using namespace __gnu_test; |
|
// Positive tests. |
VERIFY( (test_category<is_union, UnionType>(true)) ); |
|
// Negative tests. |
VERIFY( (test_category<is_union, ClassType>(false)) ); |
VERIFY( (test_category<is_union, DerivedType>(false)) ); |
VERIFY( (test_category<is_union, ConvType>(false)) ); |
VERIFY( (test_category<is_union, AbstractClass>(false)) ); |
VERIFY( (test_category<is_union, PolymorphicClass>(false)) ); |
VERIFY( (test_category<is_union, DerivedPolymorphic>(false)) ); |
VERIFY( (test_category<is_union, void>(false)) ); |
VERIFY( (test_category<is_union, int>(false)) ); |
VERIFY( (test_category<is_union, float>(false)) ); |
VERIFY( (test_category<is_union, int[2]>(false)) ); |
VERIFY( (test_category<is_union, int*>(false)) ); |
VERIFY( (test_category<is_union, int(*)(int)>(false)) ); |
VERIFY( (test_category<is_union, float&>(false)) ); |
VERIFY( (test_category<is_union, float(&)(float)>(false)) ); |
VERIFY( (test_category<is_union, int (ClassType::*)>(false)) ); |
VERIFY( (test_category<is_union, int (ClassType::*) (int)>(false)) ); |
VERIFY( (test_category<is_union, int (int)>(false)) ); |
VERIFY( (test_category<is_union, EnumType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_union/requirements/typedefs.cc
0,0 → 1,35
// 2007-04-08 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2007, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_union<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; |
} |
/is_union/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_union<test_type>; |
} |
} |
/is_arithmetic/value.cc
0,0 → 1,60
// 2004-12-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.2 Composite type traits |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_arithmetic; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_arithmetic, void>(false)) ); |
|
VERIFY( (test_category<is_arithmetic, char>(true)) ); |
VERIFY( (test_category<is_arithmetic, signed char>(true)) ); |
VERIFY( (test_category<is_arithmetic, unsigned char>(true)) ); |
#ifdef _GLIBCXX_USE_WCHAR_T |
VERIFY( (test_category<is_arithmetic, wchar_t>(true)) ); |
#endif |
VERIFY( (test_category<is_arithmetic, short>(true)) ); |
VERIFY( (test_category<is_arithmetic, unsigned short>(true)) ); |
VERIFY( (test_category<is_arithmetic, int>(true)) ); |
VERIFY( (test_category<is_arithmetic, unsigned int>(true)) ); |
VERIFY( (test_category<is_arithmetic, long>(true)) ); |
VERIFY( (test_category<is_arithmetic, unsigned long>(true)) ); |
VERIFY( (test_category<is_arithmetic, long long>(true)) ); |
VERIFY( (test_category<is_arithmetic, unsigned long long>(true)) ); |
VERIFY( (test_category<is_arithmetic, float>(true)) ); |
VERIFY( (test_category<is_arithmetic, double>(true)) ); |
VERIFY( (test_category<is_arithmetic, long double>(true)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_arithmetic, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_arithmetic/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_arithmetic<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; |
} |
/is_arithmetic/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_arithmetic<test_type>; |
} |
} |
/remove_extent/value.cc
0,0 → 1,52
// 2004-12-09 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.7.3 Array modifications |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::remove_extent; |
using std::tr1::is_same; |
using namespace __gnu_test; |
|
VERIFY( (is_same<remove_extent<int>::type, int>::value) ); |
VERIFY( (is_same<remove_extent<int[2]>::type, int>::value) ); |
VERIFY( (is_same<remove_extent<int[2][3]>::type, int[3]>::value) ); |
VERIFY( (is_same<remove_extent<int[][3]>::type, int[3]>::value) ); |
VERIFY( (is_same<remove_extent<const int[2]>::type, const int>::value) ); |
VERIFY( (is_same<remove_extent<ClassType>::type, ClassType>::value) ); |
VERIFY( (is_same<remove_extent<ClassType[2]>::type, ClassType>::value) ); |
VERIFY( (is_same<remove_extent<ClassType[2][3]>::type, |
ClassType[3]>::value) ); |
VERIFY( (is_same<remove_extent<ClassType[][3]>::type, |
ClassType[3]>::value) ); |
VERIFY( (is_same<remove_extent<const ClassType[2]>::type, |
const ClassType>::value) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/remove_extent/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct remove_extent<test_type>; |
} |
} |
/remove_cv/value.cc
0,0 → 1,46
// 2004-12-10 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.7.1 Const-volatile modifications |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::remove_cv; |
using std::tr1::is_same; |
using namespace __gnu_test; |
|
VERIFY( (is_same<remove_cv<const volatile int>::type, int>::value) ); |
VERIFY( (is_same<remove_cv<const volatile int*>::type, |
const volatile int*>::value) ); |
VERIFY( (is_same<remove_cv<const volatile ClassType>::type, |
ClassType>::value) ); |
VERIFY( (is_same<remove_cv<const volatile ClassType*>::type, |
const volatile ClassType*>::value) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/remove_cv/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct remove_cv<test_type>; |
} |
} |
/add_volatile/value.cc
0,0 → 1,55
// 2004-12-16 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2005, 2006, 2007, 2009 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/>. |
|
// 4.7.1 Const-volatile modifications |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::add_volatile; |
using std::tr1::is_same; |
using namespace __gnu_test; |
|
VERIFY( (is_same<add_volatile<int>::type, volatile int>::value) ); |
VERIFY( (is_same<add_volatile<const int>::type, const volatile int>::value) ); |
VERIFY( (is_same<add_volatile<int*>::type, int* volatile>::value) ); |
VERIFY( (is_same<add_volatile<int&>::type, int&>::value) ); |
VERIFY( (is_same<add_volatile<int (int)>::type, int (int)>::value) ); |
VERIFY( (is_same<add_volatile<volatile int>::type, volatile int>::value) ); |
VERIFY( (is_same<add_volatile<ClassType>::type, volatile ClassType>::value) ); |
VERIFY( (is_same<add_volatile<const ClassType>::type, |
const volatile ClassType>::value) ); |
VERIFY( (is_same<add_volatile<ClassType*>::type, |
ClassType* volatile>::value) ); |
VERIFY( (is_same<add_volatile<ClassType&>::type, ClassType&>::value) ); |
VERIFY( (is_same<add_volatile<ClassType (ClassType)>::type, |
ClassType (ClassType)>::value) ); |
VERIFY( (is_same<add_volatile<volatile ClassType>::type, |
volatile ClassType>::value) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/add_volatile/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct add_volatile<test_type>; |
} |
} |
/is_empty/value.cc
0,0 → 1,75
// 2005-01-28 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
class EmptyClassOne |
{ typedef int type; }; |
|
class EmptyClassTwo |
{ static int data; }; |
|
class EmptyClassThree |
{ int f(); }; |
|
class NonEmptyClassOne |
{ int data; }; |
|
class NonEmptyClassTwo |
{ |
virtual int f(); |
virtual ~NonEmptyClassTwo(); |
}; |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_empty; |
using namespace __gnu_test; |
|
// Positive tests. |
VERIFY( (test_category<is_empty, ClassType>(true)) ); |
VERIFY( (test_category<is_empty, EmptyClassOne>(true)) ); |
VERIFY( (test_category<is_empty, EmptyClassTwo>(true)) ); |
VERIFY( (test_category<is_empty, EmptyClassThree>(true)) ); |
|
// Negative tests. |
VERIFY( (test_category<is_empty, void>(false)) ); |
VERIFY( (test_category<is_empty, float>(false)) ); |
VERIFY( (test_category<is_empty, int[4]>(false)) ); |
VERIFY( (test_category<is_empty, int*>(false)) ); |
VERIFY( (test_category<is_empty, int&>(false)) ); |
VERIFY( (test_category<is_empty, int (ClassType::*)>(false)) ); |
VERIFY( (test_category<is_empty, EnumType>(false)) ); |
VERIFY( (test_category<is_empty, int (int)>(false)) ); |
|
VERIFY( (test_category<is_empty, AbstractClass>(false)) ); |
VERIFY( (test_category<is_empty, NonEmptyClassOne>(false)) ); |
VERIFY( (test_category<is_empty, NonEmptyClassTwo>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_empty/requirements/typedefs.cc
0,0 → 1,35
// 2005-01-28 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_empty<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; |
} |
/is_empty/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_empty<test_type>; |
} |
} |
/is_abstract/value.cc
0,0 → 1,48
// 2005-01-28 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_abstract; |
using namespace __gnu_test; |
|
// Positive tests. |
VERIFY( (test_category<is_abstract, AbstractClass>(true)) ); |
|
// Negative tests. |
VERIFY( (test_category<is_abstract, void>(false)) ); |
VERIFY( (test_category<is_abstract, int (int)>(false)) ); |
VERIFY( (test_category<is_abstract, int&>(false)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_abstract, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_abstract/requirements/typedefs.cc
0,0 → 1,35
// 2005-01-28 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_abstract<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; |
} |
/is_abstract/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_abstract<test_type>; |
} |
} |
/add_const/value.cc
0,0 → 1,53
// 2004-12-16 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2005, 2006, 2007, 2009 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/>. |
|
// 4.7.1 Const-volatile modifications |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::add_const; |
using std::tr1::is_same; |
using namespace __gnu_test; |
|
VERIFY( (is_same<add_const<int>::type, const int>::value) ); |
VERIFY( (is_same<add_const<volatile int>::type, const volatile int>::value) ); |
VERIFY( (is_same<add_const<int*>::type, int* const>::value) ); |
VERIFY( (is_same<add_const<int&>::type, int&>::value) ); |
VERIFY( (is_same<add_const<int (int)>::type, int (int)>::value) ); |
VERIFY( (is_same<add_const<const int>::type, const int>::value) ); |
VERIFY( (is_same<add_const<ClassType>::type, const ClassType>::value) ); |
VERIFY( (is_same<add_const<volatile ClassType>::type, |
const volatile ClassType>::value) ); |
VERIFY( (is_same<add_const<ClassType*>::type, ClassType* const>::value) ); |
VERIFY( (is_same<add_const<ClassType&>::type, ClassType&>::value) ); |
VERIFY( (is_same<add_const<ClassType (ClassType)>::type, |
ClassType (ClassType)>::value) ); |
VERIFY( (is_same<add_const<const ClassType>::type, const ClassType>::value) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/add_const/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct add_const<test_type>; |
} |
} |
/is_enum/value.cc
0,0 → 1,58
// 2004-12-25 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.1 Primary type categories |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_enum; |
using namespace __gnu_test; |
|
// Positive tests. |
VERIFY( (test_category<is_enum, EnumType>(true)) ); |
|
// Negative tests. |
VERIFY( (test_category<is_enum, void>(false)) ); |
VERIFY( (test_category<is_enum, int>(false)) ); |
VERIFY( (test_category<is_enum, float>(false)) ); |
VERIFY( (test_category<is_enum, int[2]>(false)) ); |
VERIFY( (test_category<is_enum, int*>(false)) ); |
VERIFY( (test_category<is_enum, int(*)(int)>(false)) ); |
VERIFY( (test_category<is_enum, float&>(false)) ); |
VERIFY( (test_category<is_enum, float(&)(float)>(false)) ); |
VERIFY( (test_category<is_enum, int (ClassType::*)>(false)) ); |
VERIFY( (test_category<is_enum, int (ClassType::*) (int)>(false)) ); |
VERIFY( (test_category<is_enum, int (int)>(false)) ); |
|
VERIFY( (test_category<is_enum, ConvType>(false)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_enum, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_enum/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-25 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_enum<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; |
} |
/is_enum/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_enum<test_type>; |
} |
} |
/is_enum/24808.cc
0,0 → 1,40
// 2005-11-11 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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/>. |
|
// 4.5.1 Primary type categories |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
// libstdc++/24808 |
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_enum; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_enum, IncompleteClass>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/remove_all_extents/value.cc
0,0 → 1,53
// 2004-12-09 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.7.3 Array modifications |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::remove_all_extents; |
using std::tr1::is_same; |
using namespace __gnu_test; |
|
VERIFY( (is_same<remove_all_extents<int>::type, int>::value) ); |
VERIFY( (is_same<remove_all_extents<int[2]>::type, int>::value) ); |
VERIFY( (is_same<remove_all_extents<int[2][3]>::type, int>::value) ); |
VERIFY( (is_same<remove_all_extents<int[][3]>::type, int>::value) ); |
VERIFY( (is_same<remove_all_extents<const int[2][3]>::type, |
const int>::value) ); |
VERIFY( (is_same<remove_all_extents<ClassType>::type, ClassType>::value) ); |
VERIFY( (is_same<remove_all_extents<ClassType[2]>::type, ClassType>::value) ); |
VERIFY( (is_same<remove_all_extents<ClassType[2][3]>::type, |
ClassType>::value) ); |
VERIFY( (is_same<remove_all_extents<ClassType[][3]>::type, |
ClassType>::value) ); |
VERIFY( (is_same<remove_all_extents<const ClassType[2][3]>::type, |
const ClassType>::value) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/remove_all_extents/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct remove_all_extents<test_type>; |
} |
} |
/is_integral/value.cc
0,0 → 1,61
// 2004-12-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.1 Primary type categories |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_integral; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_integral, void>(false)) ); |
|
VERIFY( (test_category<is_integral, char>(true)) ); |
VERIFY( (test_category<is_integral, signed char>(true)) ); |
VERIFY( (test_category<is_integral, unsigned char>(true)) ); |
#ifdef _GLIBCXX_USE_WCHAR_T |
VERIFY( (test_category<is_integral, wchar_t>(true)) ); |
#endif |
VERIFY( (test_category<is_integral, short>(true)) ); |
VERIFY( (test_category<is_integral, unsigned short>(true)) ); |
VERIFY( (test_category<is_integral, int>(true)) ); |
VERIFY( (test_category<is_integral, unsigned int>(true)) ); |
VERIFY( (test_category<is_integral, long>(true)) ); |
VERIFY( (test_category<is_integral, unsigned long>(true)) ); |
VERIFY( (test_category<is_integral, long long>(true)) ); |
VERIFY( (test_category<is_integral, unsigned long long>(true)) ); |
|
VERIFY( (test_category<is_integral, float>(false)) ); |
VERIFY( (test_category<is_integral, double>(false)) ); |
VERIFY( (test_category<is_integral, long double>(false)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_integral, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_integral/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_integral<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; |
} |
/is_integral/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_integral<test_type>; |
} |
} |
/is_object/value.cc
0,0 → 1,49
// 2004-12-16 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.2 Composite type traits |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_object; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_object, int (int)>(false)) ); |
VERIFY( (test_category<is_object, ClassType (ClassType)>(false)) ); |
VERIFY( (test_category<is_object, float (int, float, int[], int&)>(false)) ); |
VERIFY( (test_category<is_object, int&>(false)) ); |
VERIFY( (test_category<is_object, ClassType&>(false)) ); |
VERIFY( (test_category<is_object, int(&)(int)>(false)) ); |
VERIFY( (test_category<is_object, void>(false)) ); |
VERIFY( (test_category<is_object, const void>(false)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_object, ClassType>(true)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_object/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-16 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_object<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; |
} |
/is_object/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_object<test_type>; |
} |
} |
/is_object/24808.cc
0,0 → 1,40
// 2005-11-11 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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/>. |
|
// 4.5.2 Composite type traits |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
// libstdc++/24808 |
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_object; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_object, IncompleteClass>(true)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/remove_const/value.cc
0,0 → 1,46
// 2004-12-10 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.7.1 Const-volatile modifications |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::remove_const; |
using std::tr1::is_same; |
using namespace __gnu_test; |
|
VERIFY( (is_same<remove_const<const volatile int>::type, |
volatile int>::value) ); |
VERIFY( (is_same<remove_const<const int*>::type, const int*>::value) ); |
VERIFY( (is_same<remove_const<const volatile ClassType>::type, |
volatile ClassType>::value) ); |
VERIFY( (is_same<remove_const<const ClassType*>::type, |
const ClassType*>::value) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/remove_const/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct remove_const<test_type>; |
} |
} |
/add_reference/value.cc
0,0 → 1,48
// 2004-12-08 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2005, 2006, 2007, 2009 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/>. |
|
// 4.7.2 Reference modifications |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::add_reference; |
using std::tr1::is_same; |
using namespace __gnu_test; |
|
VERIFY( (is_same<add_reference<int>::type, int&>::value) ); |
VERIFY( (is_same<add_reference<int&>::type, int&>::value) ); |
VERIFY( (is_same<add_reference<const int>::type, const int&>::value) ); |
VERIFY( (is_same<add_reference<int*>::type, int*&>::value) ); |
VERIFY( (is_same<add_reference<ClassType&>::type, ClassType&>::value) ); |
VERIFY( (is_same<add_reference<ClassType>::type, ClassType&>::value) ); |
|
VERIFY( (is_same<add_reference<void>::type, void>::value) ); |
VERIFY( (is_same<add_reference<const void>::type, const void>::value) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/add_reference/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct add_reference<test_type>; |
} |
} |
/is_convertible/value.cc
0,0 → 1,86
// 2005-02-23 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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/>. |
|
// 4.6 Relationships between types |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_convertible; |
using namespace __gnu_test; |
|
// Positive tests. |
VERIFY( (test_relationship<is_convertible, int, int>(true)) ); |
VERIFY( (test_relationship<is_convertible, int, const int>(true)) ); |
VERIFY( (test_relationship<is_convertible, volatile int, const int>(true)) ); |
VERIFY( (test_relationship<is_convertible, int, float>(true)) ); |
VERIFY( (test_relationship<is_convertible, double, float>(true)) ); |
VERIFY( (test_relationship<is_convertible, float, int>(true)) ); |
VERIFY( (test_relationship<is_convertible, int*, const int*>(true)) ); |
VERIFY( (test_relationship<is_convertible, int*, void*>(true)) ); |
VERIFY( (test_relationship<is_convertible, int[4], int*>(true)) ); |
VERIFY( (test_relationship<is_convertible, float&, int>(true)) ); |
VERIFY( (test_relationship<is_convertible, int, const int&>(true)) ); |
VERIFY( (test_relationship<is_convertible, const int&, int>(true)) ); |
VERIFY( (test_relationship<is_convertible, float, const int&>(true)) ); |
VERIFY( (test_relationship<is_convertible, float, volatile float&>(true)) ); |
VERIFY( (test_relationship<is_convertible, int(int), int(*)(int)>(true)) ); |
VERIFY( (test_relationship<is_convertible, int(int), int(&)(int)>(true)) ); |
VERIFY( (test_relationship<is_convertible, int(&)(int), int(*)(int)>(true)) ); |
VERIFY( (test_relationship<is_convertible, EnumType, int>(true)) ); |
VERIFY( (test_relationship<is_convertible, ClassType, ClassType>(true)) ); |
VERIFY( (test_relationship<is_convertible, DerivedType, ClassType>(true)) ); |
VERIFY( (test_relationship<is_convertible, DerivedType*, ClassType*>(true)) ); |
VERIFY( (test_relationship<is_convertible, DerivedType&, ClassType&>(true)) ); |
|
VERIFY( (test_relationship<is_convertible, void, void>(true)) ); |
VERIFY( (test_relationship<is_convertible, int, void>(true)) ); |
VERIFY( (test_relationship<is_convertible, int[4], void>(true)) ); |
|
// Negative tests. |
VERIFY( (test_relationship<is_convertible, const int*, int*>(false)) ); |
VERIFY( (test_relationship<is_convertible, int*, float*>(false)) ); |
VERIFY( (test_relationship<is_convertible, const int[4], int*>(false)) ); |
VERIFY( (test_relationship<is_convertible, int[4], int[4]>(false)) ); |
VERIFY( (test_relationship<is_convertible, const int&, int&>(false)) ); |
VERIFY( (test_relationship<is_convertible, float&, int&>(false)) ); |
VERIFY( (test_relationship<is_convertible, float, volatile int&>(false)) ); |
VERIFY( (test_relationship<is_convertible, int(int), int(int)>(false)) ); |
VERIFY( (test_relationship<is_convertible, int(int), int(*)(void)>(false)) ); |
VERIFY( (test_relationship<is_convertible, int(*)(int), int(&)(int)>(false)) ); |
VERIFY( (test_relationship<is_convertible, int, EnumType>(false)) ); |
VERIFY( (test_relationship<is_convertible, int, ClassType>(false)) ); |
VERIFY( (test_relationship<is_convertible, ClassType, DerivedType>(false)) ); |
VERIFY( (test_relationship<is_convertible, ClassType*, DerivedType*>(false)) ); |
VERIFY( (test_relationship<is_convertible, ClassType&, DerivedType&>(false)) ); |
|
VERIFY( (test_relationship<is_convertible, void, int>(false)) ); |
VERIFY( (test_relationship<is_convertible, void, float>(false)) ); |
VERIFY( (test_relationship<is_convertible, void, int(*)(int)>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_convertible/requirements/typedefs.cc
0,0 → 1,35
// 2005-02-23 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_convertible<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; |
} |
/is_convertible/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_convertible<test_type, test_type>; |
} |
} |
/is_floating_point/value.cc
0,0 → 1,60
// 2004-12-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.1 Primary type categories |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_floating_point; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_floating_point, void>(false)) ); |
VERIFY( (test_category<is_floating_point, char>(false)) ); |
VERIFY( (test_category<is_floating_point, signed char>(false)) ); |
VERIFY( (test_category<is_floating_point, unsigned char>(false)) ); |
#ifdef _GLIBCXX_USE_WCHAR_T |
VERIFY( (test_category<is_floating_point, wchar_t>(false)) ); |
#endif |
VERIFY( (test_category<is_floating_point, short>(false)) ); |
VERIFY( (test_category<is_floating_point, unsigned short>(false)) ); |
VERIFY( (test_category<is_floating_point, int>(false)) ); |
VERIFY( (test_category<is_floating_point, unsigned int>(false)) ); |
VERIFY( (test_category<is_floating_point, long>(false)) ); |
VERIFY( (test_category<is_floating_point, unsigned long>(false)) ); |
VERIFY( (test_category<is_floating_point, long long>(false)) ); |
VERIFY( (test_category<is_floating_point, unsigned long long>(false)) ); |
|
VERIFY( (test_category<is_floating_point, float>(true)) ); |
VERIFY( (test_category<is_floating_point, double>(true)) ); |
VERIFY( (test_category<is_floating_point, long double>(true)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_floating_point, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_floating_point/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_floating_point<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; |
} |
/is_floating_point/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_floating_point<test_type>; |
} |
} |
/remove_reference/value.cc
0,0 → 1,45
// 2004-12-08 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.7.2 Reference modifications |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::remove_reference; |
using std::tr1::is_same; |
using namespace __gnu_test; |
|
VERIFY( (is_same<remove_reference<int&>::type, int>::value) ); |
VERIFY( (is_same<remove_reference<int>::type, int>::value) ); |
VERIFY( (is_same<remove_reference<const int&>::type, const int>::value) ); |
VERIFY( (is_same<remove_reference<int*&>::type, int*>::value) ); |
VERIFY( (is_same<remove_reference<ClassType&>::type, ClassType>::value) ); |
VERIFY( (is_same<remove_reference<ClassType>::type, ClassType>::value) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/remove_reference/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct remove_reference<test_type>; |
} |
} |
/is_pod/value.cc
0,0 → 1,54
// 2004-12-26 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2005, 2006, 2007, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_pod; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_pod, void>(true)) ); |
VERIFY( (test_category<is_pod, int>(true)) ); |
VERIFY( (test_category<is_pod, float>(true)) ); |
VERIFY( (test_category<is_pod, EnumType>(true)) ); |
VERIFY( (test_category<is_pod, int*>(true)) ); |
VERIFY( (test_category<is_pod, int(*)(int)>(true)) ); |
VERIFY( (test_category<is_pod, int (ClassType::*)>(true)) ); |
VERIFY( (test_category<is_pod, int (ClassType::*) (int)>(true)) ); |
VERIFY( (test_category<is_pod, int[2]>(true)) ); |
VERIFY( (test_category<is_pod, float[][3]>(true)) ); |
VERIFY( (test_category<is_pod, EnumType[2][3][4]>(true)) ); |
VERIFY( (test_category<is_pod, int*[3]>(true)) ); |
VERIFY( (test_category<is_pod, int(*[][2])(int)>(true)) ); |
VERIFY( (test_category<is_pod, int (ClassType::*[2][3])>(true)) ); |
VERIFY( (test_category<is_pod, int (ClassType::*[][2][3]) (int)>(true)) ); |
VERIFY( (test_category<is_pod, ClassType>(true)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_pod/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-26 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_pod<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; |
} |
/is_pod/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_pod<test_type>; |
} |
} |
/integral_constant/true_false_type_typedefs.cc
0,0 → 1,42
// 2004-12-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::true_type true_type; |
typedef std::tr1::false_type false_type; |
|
typedef true_type::value_type true_value_type; |
typedef true_type::type true_type; |
typedef true_type::type::value_type true_type_value_type; |
typedef true_type::type::type true_type_type; |
|
typedef false_type::value_type false_value_type; |
typedef false_type::type false_type; |
typedef false_type::type::value_type false_type_value_type; |
typedef false_type::type::type false_type_type; |
} |
/integral_constant/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::integral_constant<int, 1> 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; |
} |
/integral_constant/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct integral_constant<test_type, -3>; |
} |
} |
/integral_constant/static_definition.cc
0,0 → 1,36
// 2006-05-07 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2006, 2009 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/>. |
|
// 4.3 Helper classes |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
const bool* p = &std::tr1::integral_constant<bool, true>::value; |
VERIFY( p ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/integral_constant/true_false_value.cc
0,0 → 1,41
// 2004-12-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.3 Helper classes |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::true_type; |
using std::tr1::false_type; |
|
VERIFY( true_type::value == true ); |
VERIFY( false_type::value == false ); |
VERIFY( true_type::type::value == true ); |
VERIFY( false_type::type::value == false ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_compound/value.cc
0,0 → 1,59
// 2004-12-11 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.2 Composite type traits |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_compound; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_compound, void>(false)) ); |
VERIFY( (test_category<is_compound, char>(false)) ); |
VERIFY( (test_category<is_compound, signed char>(false)) ); |
VERIFY( (test_category<is_compound, unsigned char>(false)) ); |
#ifdef _GLIBCXX_USE_WCHAR_T |
VERIFY( (test_category<is_compound, wchar_t>(false)) ); |
#endif |
VERIFY( (test_category<is_compound, short>(false)) ); |
VERIFY( (test_category<is_compound, unsigned short>(false)) ); |
VERIFY( (test_category<is_compound, int>(false)) ); |
VERIFY( (test_category<is_compound, unsigned int>(false)) ); |
VERIFY( (test_category<is_compound, long>(false)) ); |
VERIFY( (test_category<is_compound, unsigned long>(false)) ); |
VERIFY( (test_category<is_compound, long long>(false)) ); |
VERIFY( (test_category<is_compound, unsigned long long>(false)) ); |
VERIFY( (test_category<is_compound, float>(false)) ); |
VERIFY( (test_category<is_compound, double>(false)) ); |
VERIFY( (test_category<is_compound, long double>(false)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_compound, ClassType>(true)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_compound/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-11 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_compound<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; |
} |
/is_compound/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_compound<test_type>; |
} |
} |
/add_cv/value.cc
0,0 → 1,56
// 2004-12-16 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2005, 2006, 2007, 2009 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/>. |
|
// 4.7.1 Const-volatile modifications |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::add_cv; |
using std::tr1::is_same; |
using namespace __gnu_test; |
|
VERIFY( (is_same<add_cv<int>::type, const volatile int>::value) ); |
VERIFY( (is_same<add_cv<const int>::type, const volatile int>::value) ); |
VERIFY( (is_same<add_cv<int*>::type, int* const volatile>::value) ); |
VERIFY( (is_same<add_cv<int&>::type, int&>::value) ); |
VERIFY( (is_same<add_cv<int (int)>::type, int (int)>::value) ); |
VERIFY( (is_same<add_cv<const volatile int>::type, |
const volatile int>::value) ); |
VERIFY( (is_same<add_cv<ClassType>::type, const volatile ClassType>::value) ); |
VERIFY( (is_same<add_cv<volatile ClassType>::type, |
const volatile ClassType>::value) ); |
VERIFY( (is_same<add_cv<ClassType*>::type, |
ClassType* const volatile>::value) ); |
VERIFY( (is_same<add_cv<ClassType&>::type, ClassType&>::value) ); |
VERIFY( (is_same<add_cv<ClassType (ClassType)>::type, |
ClassType (ClassType)>::value) ); |
VERIFY( (is_same<add_cv<const volatile ClassType>::type, |
const volatile ClassType>::value) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/add_cv/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct add_cv<test_type>; |
} |
} |
/is_function/value.cc
0,0 → 1,54
// 2004-12-16 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2005, 2006, 2007, 2009 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/>. |
|
// 4.5.1 Primary type categories |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_function; |
using namespace __gnu_test; |
|
// Positive tests. |
VERIFY( (test_category<is_function, int (int)>(true)) ); |
VERIFY( (test_category<is_function, ClassType (ClassType)>(true)) ); |
VERIFY( (test_category<is_function, float (int, float, int[], int&)>(true)) ); |
VERIFY( (test_category<is_function, int (int, ...)>(true)) ); |
|
// Negative tests. |
VERIFY( (test_category<is_function, int&>(false)) ); |
VERIFY( (test_category<is_function, void>(false)) ); |
VERIFY( (test_category<is_function, const void>(false)) ); |
|
VERIFY( (test_category<is_function, AbstractClass>(false)) ); |
VERIFY( (test_category<is_function, int(&)(int)>(false)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_function, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_function/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-16 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_function<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; |
} |
/is_function/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_function<test_type>; |
} |
} |
/is_function/24808.cc
0,0 → 1,40
// 2005-11-11 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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/>. |
|
// 4.5.1 Primary type categories |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
// libstdc++/24808 |
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_function; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_function, IncompleteClass>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_function/35637.cc
0,0 → 1,34
// { dg-options "-pedantic-errors" } |
// { dg-do compile } |
|
// Copyright (C) 2008, 2009 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/>. |
|
// 4.5.1 Primary type categories |
|
#include <tr1/functional> |
|
struct S |
{ |
void F() const {} |
}; |
|
// libstdc++/35637 |
void test01() |
{ |
std::tr1::function<void (S *)> a(&S::F); |
} |
/is_const/value.cc
0,0 → 1,49
// 2004-12-07 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_const; |
using namespace __gnu_test; |
|
// Positive tests. |
VERIFY( (test_property<is_const, const int>(true)) ); |
VERIFY( (test_property<is_const, const volatile int>(true)) ); |
VERIFY( (test_property<is_const, cClassType>(true)) ); |
VERIFY( (test_property<is_const, cvClassType>(true)) ); |
|
// Negative tests. |
VERIFY( (test_property<is_const, int>(false)) ); |
VERIFY( (test_property<is_const, volatile int>(false)) ); |
VERIFY( (test_property<is_const, ClassType>(false)) ); |
VERIFY( (test_property<is_const, vClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_const/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-07 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_const<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; |
} |
/is_const/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_const<test_type>; |
} |
} |
/has_nothrow_copy/value.cc
0,0 → 1,54
// 2004-12-30 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2005, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::has_nothrow_copy; |
using namespace __gnu_test; |
|
VERIFY( (test_category<has_nothrow_copy, void>(true)) ); |
VERIFY( (test_category<has_nothrow_copy, int>(true)) ); |
VERIFY( (test_category<has_nothrow_copy, float>(true)) ); |
VERIFY( (test_category<has_nothrow_copy, EnumType>(true)) ); |
VERIFY( (test_category<has_nothrow_copy, int*>(true)) ); |
VERIFY( (test_category<has_nothrow_copy, int(*)(int)>(true)) ); |
VERIFY( (test_category<has_nothrow_copy, int (ClassType::*)>(true)) ); |
VERIFY( (test_category<has_nothrow_copy, int (ClassType::*) (int)>(true)) ); |
VERIFY( (test_category<has_nothrow_copy, int[2]>(true)) ); |
VERIFY( (test_category<has_nothrow_copy, float[][3]>(true)) ); |
VERIFY( (test_category<has_nothrow_copy, EnumType[2][3][4]>(true)) ); |
VERIFY( (test_category<has_nothrow_copy, int*[3]>(true)) ); |
VERIFY( (test_category<has_nothrow_copy, int(*[][2])(int)>(true)) ); |
VERIFY( (test_category<has_nothrow_copy, int (ClassType::*[2][3])>(true)) ); |
VERIFY( (test_category<has_nothrow_copy, |
int (ClassType::*[][2][3]) (int)>(true)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/has_nothrow_copy/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-30 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::has_nothrow_copy<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; |
} |
/has_nothrow_copy/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct has_nothrow_copy<test_type>; |
} |
} |
/aligned_storage/value.cc
0,0 → 1,62
// 2005-01-11 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2006, 2007, 2009 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/>. |
|
// 4.8 Other transformations |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::aligned_storage; |
using std::tr1::alignment_of; |
using namespace __gnu_test; |
|
const std::size_t align_c = alignment_of<char>::value; |
VERIFY( (sizeof(aligned_storage<4, align_c>::type) >= 4) ); |
VERIFY( (__alignof__(aligned_storage<4, align_c>::type) == align_c) ); |
|
const std::size_t align_s = alignment_of<short>::value; |
VERIFY( (sizeof(aligned_storage<1, align_s>::type) >= 1) ); |
VERIFY( (__alignof__(aligned_storage<1, align_s>::type) == align_s) ); |
|
const std::size_t align_i = alignment_of<int>::value; |
VERIFY( (sizeof(aligned_storage<7, align_i>::type) >= 7) ); |
VERIFY( (__alignof__(aligned_storage<7, align_i>::type) == align_i) ); |
|
const std::size_t align_d = alignment_of<double>::value; |
VERIFY( (sizeof(aligned_storage<2, align_d>::type) >= 2) ); |
VERIFY( (__alignof__(aligned_storage<2, align_d>::type) == align_d) ); |
|
const std::size_t align_ai = alignment_of<int[4]>::value; |
VERIFY( (sizeof(aligned_storage<20, align_ai>::type) >= 20) ); |
VERIFY( (__alignof__(aligned_storage<20, align_ai>::type) == align_ai) ); |
|
const std::size_t align_ct = alignment_of<ClassType>::value; |
VERIFY( (sizeof(aligned_storage<11, align_ct>::type) >= 11) ); |
VERIFY( (__alignof__(aligned_storage<11, align_ct>::type) == align_ct) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/aligned_storage/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct aligned_storage<1, alignment_of<test_type>::value>; |
} |
} |
/is_member_object_pointer/value.cc
0,0 → 1,60
// 2004-12-24 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.1 Primary type categories |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_member_object_pointer; |
using namespace __gnu_test; |
|
// Positive tests. |
VERIFY( (test_category<is_member_object_pointer, |
int (ClassType::*)>(true)) ); |
VERIFY( (test_category<is_member_object_pointer, |
const int (ClassType::*)>(true)) ); |
VERIFY( (test_category<is_member_object_pointer, |
ClassType (ClassType::*)>(true)) ); |
|
// Negative tests. |
VERIFY( (test_category<is_member_object_pointer, |
int (ClassType::*) (int)>(false)) ); |
VERIFY( (test_category<is_member_object_pointer, |
int (ClassType::*) (int) const>(false)) ); |
VERIFY( (test_category<is_member_object_pointer, |
int (ClassType::*) (float, ...)>(false)) ); |
VERIFY( (test_category<is_member_object_pointer, |
ClassType (ClassType::*) (ClassType)>(false)) ); |
VERIFY( (test_category<is_member_object_pointer, |
float (ClassType::*) (int, float, int[], int&)>(false)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_member_object_pointer, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_member_object_pointer/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-24 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_member_object_pointer<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; |
} |
/is_member_object_pointer/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_member_object_pointer<test_type>; |
} |
} |
/add_pointer/value.cc
0,0 → 1,45
// 2004-12-12 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2005, 2006, 2007, 2009 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/>. |
|
// 4.7.2 Reference modifications |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::add_pointer; |
using std::tr1::is_same; |
using namespace __gnu_test; |
|
VERIFY( (is_same<add_pointer<int>::type, int*>::value) ); |
VERIFY( (is_same<add_pointer<int*>::type, int**>::value) ); |
VERIFY( (is_same<add_pointer<const int>::type, const int*>::value) ); |
VERIFY( (is_same<add_pointer<int&>::type, int*>::value) ); |
VERIFY( (is_same<add_pointer<ClassType*>::type, ClassType**>::value) ); |
VERIFY( (is_same<add_pointer<ClassType>::type, ClassType*>::value) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/add_pointer/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct add_pointer<test_type>; |
} |
} |
/is_reference/value.cc
0,0 → 1,44
// 2004-12-06 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.1 Primary type categories |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_reference; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_reference, int&>(true)) ); |
VERIFY( (test_category<is_reference, ClassType&>(true)) ); |
VERIFY( (test_category<is_reference, int(&)(int)>(true)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_reference, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_reference/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-06 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_reference<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; |
} |
/is_reference/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_reference<test_type>; |
} |
} |
/is_base_of/value.cc
0,0 → 1,93
// 2005-03-04 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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/>. |
|
// 4.6 Relationships between types |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
class HiddenCons |
{ |
HiddenCons(); |
HiddenCons(const HiddenCons&); |
}; |
|
class DerivedHiddenCons |
: private HiddenCons |
{ |
DerivedHiddenCons(); |
DerivedHiddenCons(const DerivedHiddenCons&); |
}; |
|
class MultiDerivedHiddenCons |
: private HiddenCons, private __gnu_test::ClassType |
{ |
MultiDerivedHiddenCons(); |
MultiDerivedHiddenCons(const MultiDerivedHiddenCons&); |
}; |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_base_of; |
using namespace __gnu_test; |
|
// Positive tests. |
VERIFY( (test_relationship<is_base_of, int, int>(true)) ); |
VERIFY( (test_relationship<is_base_of, EnumType, EnumType>(true)) ); |
VERIFY( (test_relationship<is_base_of, UnionType, UnionType>(true)) ); |
VERIFY( (test_relationship<is_base_of, AbstractClass, |
AbstractClass>(true)) ); |
VERIFY( (test_relationship<is_base_of, ClassType, DerivedType>(true)) ); |
VERIFY( (test_relationship<is_base_of, ClassType, const DerivedType>(true)) ); |
VERIFY( (test_relationship<is_base_of, volatile ClassType, |
volatile DerivedType>(true)) ); |
VERIFY( (test_relationship<is_base_of, PolymorphicClass, |
DerivedPolymorphic>(true)) ); |
VERIFY( (test_relationship<is_base_of, HiddenCons, |
DerivedHiddenCons>(true)) ); |
VERIFY( (test_relationship<is_base_of, HiddenCons, |
MultiDerivedHiddenCons>(true)) ); |
VERIFY( (test_relationship<is_base_of, ClassType, |
MultiDerivedHiddenCons>(true)) ); |
|
// Negative tests. |
VERIFY( (test_relationship<is_base_of, int, const int>(false)) ); |
VERIFY( (test_relationship<is_base_of, volatile UnionType, |
UnionType>(false)) ); |
VERIFY( (test_relationship<is_base_of, int&, ClassType>(false)) ); |
VERIFY( (test_relationship<is_base_of, AbstractClass, ClassType>(false)) ); |
VERIFY( (test_relationship<is_base_of, ClassType, AbstractClass>(false)) ); |
VERIFY( (test_relationship<is_base_of, DerivedType, ClassType>(false)) ); |
VERIFY( (test_relationship<is_base_of, DerivedPolymorphic, |
PolymorphicClass>(false)) ); |
VERIFY( (test_relationship<is_base_of, DerivedHiddenCons, |
HiddenCons>(false)) ); |
VERIFY( (test_relationship<is_base_of, MultiDerivedHiddenCons, |
HiddenCons>(false)) ); |
VERIFY( (test_relationship<is_base_of, MultiDerivedHiddenCons, |
ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_base_of/requirements/typedefs.cc
0,0 → 1,35
// 2005-03-04 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_base_of<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; |
} |
/is_base_of/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_base_of<test_type, test_type>; |
} |
} |
/is_fundamental/value.cc
0,0 → 1,59
// 2004-12-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.2 Composite type traits |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_fundamental; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_fundamental, void>(true)) ); |
VERIFY( (test_category<is_fundamental, char>(true)) ); |
VERIFY( (test_category<is_fundamental, signed char>(true)) ); |
VERIFY( (test_category<is_fundamental, unsigned char>(true)) ); |
#ifdef _GLIBCXX_USE_WCHAR_T |
VERIFY( (test_category<is_fundamental, wchar_t>(true)) ); |
#endif |
VERIFY( (test_category<is_fundamental, short>(true)) ); |
VERIFY( (test_category<is_fundamental, unsigned short>(true)) ); |
VERIFY( (test_category<is_fundamental, int>(true)) ); |
VERIFY( (test_category<is_fundamental, unsigned int>(true)) ); |
VERIFY( (test_category<is_fundamental, long>(true)) ); |
VERIFY( (test_category<is_fundamental, unsigned long>(true)) ); |
VERIFY( (test_category<is_fundamental, long long>(true)) ); |
VERIFY( (test_category<is_fundamental, unsigned long long>(true)) ); |
VERIFY( (test_category<is_fundamental, float>(true)) ); |
VERIFY( (test_category<is_fundamental, double>(true)) ); |
VERIFY( (test_category<is_fundamental, long double>(true)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_fundamental, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_fundamental/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_fundamental<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; |
} |
/is_fundamental/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_fundamental<test_type>; |
} |
} |
/rank/value.cc
0,0 → 1,46
// 2004-12-11 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::rank; |
using namespace __gnu_test; |
|
VERIFY( (test_property<rank, int>(0)) ); |
VERIFY( (test_property<rank, int[2]>(1)) ); |
VERIFY( (test_property<rank, int[][4]>(2)) ); |
VERIFY( (test_property<rank, int[2][2][4][4][6][6]>(6)) ); |
VERIFY( (test_property<rank, ClassType>(0)) ); |
VERIFY( (test_property<rank, ClassType[2]>(1)) ); |
VERIFY( (test_property<rank, ClassType[][4]>(2)) ); |
VERIFY( (test_property<rank, ClassType[2][2][4][4][6][6]>(6)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/rank/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-11 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::rank<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; |
} |
/rank/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct rank<test_type>; |
} |
} |
/is_void/value.cc
0,0 → 1,60
// 2004-12-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.1 Primary type categories |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_void; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_void, void>(true)) ); |
|
VERIFY( (test_category<is_void, char>(false)) ); |
VERIFY( (test_category<is_void, signed char>(false)) ); |
VERIFY( (test_category<is_void, unsigned char>(false)) ); |
#ifdef _GLIBCXX_USE_WCHAR_T |
VERIFY( (test_category<is_void, wchar_t>(false)) ); |
#endif |
VERIFY( (test_category<is_void, short>(false)) ); |
VERIFY( (test_category<is_void, unsigned short>(false)) ); |
VERIFY( (test_category<is_void, int>(false)) ); |
VERIFY( (test_category<is_void, unsigned int>(false)) ); |
VERIFY( (test_category<is_void, long>(false)) ); |
VERIFY( (test_category<is_void, unsigned long>(false)) ); |
VERIFY( (test_category<is_void, long long>(false)) ); |
VERIFY( (test_category<is_void, unsigned long long>(false)) ); |
VERIFY( (test_category<is_void, float>(false)) ); |
VERIFY( (test_category<is_void, double>(false)) ); |
VERIFY( (test_category<is_void, long double>(false)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_void, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_void/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_void<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; |
} |
/is_void/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_void<test_type>; |
} |
} |
/remove_volatile/value.cc
0,0 → 1,47
// 2004-12-10 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.7.1 Const-volatile modifications |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::remove_volatile; |
using std::tr1::is_same; |
using namespace __gnu_test; |
|
VERIFY( (is_same<remove_volatile<const volatile int>::type, |
const int>::value) ); |
VERIFY( (is_same<remove_volatile<volatile int*>::type, |
volatile int*>::value) ); |
VERIFY( (is_same<remove_volatile<const volatile ClassType>::type, |
const ClassType>::value) ); |
VERIFY( (is_same<remove_volatile<volatile ClassType*>::type, |
volatile ClassType*>::value) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/remove_volatile/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct remove_volatile<test_type>; |
} |
} |
/remove_pointer/value.cc
0,0 → 1,45
// 2004-12-12 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.7.2 Reference modifications |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::remove_pointer; |
using std::tr1::is_same; |
using namespace __gnu_test; |
|
VERIFY( (is_same<remove_pointer<int*>::type, int>::value) ); |
VERIFY( (is_same<remove_pointer<int>::type, int>::value) ); |
VERIFY( (is_same<remove_pointer<const int*>::type, const int>::value) ); |
VERIFY( (is_same<remove_pointer<int**>::type, int*>::value) ); |
VERIFY( (is_same<remove_pointer<ClassType*>::type, ClassType>::value) ); |
VERIFY( (is_same<remove_pointer<ClassType>::type, ClassType>::value) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/remove_pointer/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct remove_pointer<test_type>; |
} |
} |
/has_nothrow_assign/value.cc
0,0 → 1,54
// 2004-12-30 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2005, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::has_nothrow_assign; |
using namespace __gnu_test; |
|
VERIFY( (test_category<has_nothrow_assign, void>(true)) ); |
VERIFY( (test_category<has_nothrow_assign, int>(true)) ); |
VERIFY( (test_category<has_nothrow_assign, float>(true)) ); |
VERIFY( (test_category<has_nothrow_assign, EnumType>(true)) ); |
VERIFY( (test_category<has_nothrow_assign, int*>(true)) ); |
VERIFY( (test_category<has_nothrow_assign, int(*)(int)>(true)) ); |
VERIFY( (test_category<has_nothrow_assign, int (ClassType::*)>(true)) ); |
VERIFY( (test_category<has_nothrow_assign, int (ClassType::*) (int)>(true)) ); |
VERIFY( (test_category<has_nothrow_assign, int[2]>(true)) ); |
VERIFY( (test_category<has_nothrow_assign, float[][3]>(true)) ); |
VERIFY( (test_category<has_nothrow_assign, EnumType[2][3][4]>(true)) ); |
VERIFY( (test_category<has_nothrow_assign, int*[3]>(true)) ); |
VERIFY( (test_category<has_nothrow_assign, int(*[][2])(int)>(true)) ); |
VERIFY( (test_category<has_nothrow_assign, int (ClassType::*[2][3])>(true)) ); |
VERIFY( (test_category<has_nothrow_assign, |
int (ClassType::*[][2][3]) (int)>(true)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/has_nothrow_assign/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-30 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::has_nothrow_assign<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; |
} |
/has_nothrow_assign/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct has_nothrow_assign<test_type>; |
} |
} |
/has_trivial_copy/value.cc
0,0 → 1,54
// 2004-12-30 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2005, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::has_trivial_copy; |
using namespace __gnu_test; |
|
VERIFY( (test_category<has_trivial_copy, void>(true)) ); |
VERIFY( (test_category<has_trivial_copy, int>(true)) ); |
VERIFY( (test_category<has_trivial_copy, float>(true)) ); |
VERIFY( (test_category<has_trivial_copy, EnumType>(true)) ); |
VERIFY( (test_category<has_trivial_copy, int*>(true)) ); |
VERIFY( (test_category<has_trivial_copy, int(*)(int)>(true)) ); |
VERIFY( (test_category<has_trivial_copy, int (ClassType::*)>(true)) ); |
VERIFY( (test_category<has_trivial_copy, int (ClassType::*) (int)>(true)) ); |
VERIFY( (test_category<has_trivial_copy, int[2]>(true)) ); |
VERIFY( (test_category<has_trivial_copy, float[][3]>(true)) ); |
VERIFY( (test_category<has_trivial_copy, EnumType[2][3][4]>(true)) ); |
VERIFY( (test_category<has_trivial_copy, int*[3]>(true)) ); |
VERIFY( (test_category<has_trivial_copy, int(*[][2])(int)>(true)) ); |
VERIFY( (test_category<has_trivial_copy, int (ClassType::*[2][3])>(true)) ); |
VERIFY( (test_category<has_trivial_copy, |
int (ClassType::*[][2][3]) (int)>(true)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/has_trivial_copy/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-30 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::has_trivial_copy<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; |
} |
/has_trivial_copy/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct has_trivial_copy<test_type>; |
} |
} |
/has_virtual_destructor/value.cc
0,0 → 1,55
// 2007-04-08 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2007, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <iostream> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::has_virtual_destructor; |
using namespace __gnu_test; |
|
// Positive tests. |
VERIFY( (test_category<has_virtual_destructor, |
VirtualDestructorClass>(true)) ); |
VERIFY( (test_category<has_virtual_destructor, std::iostream>(true)) ); |
VERIFY( (test_category<has_virtual_destructor, std::streambuf>(true)) ); |
|
// Negative tests. |
VERIFY( (test_category<has_virtual_destructor, PolymorphicClass>(false)) ); |
VERIFY( (test_category<has_virtual_destructor, DerivedPolymorphic>(false)) ); |
VERIFY( (test_category<has_virtual_destructor, AbstractClass>(false)) ); |
VERIFY( (test_category<has_virtual_destructor, void>(false)) ); |
VERIFY( (test_category<has_virtual_destructor, int (int)>(false)) ); |
VERIFY( (test_category<has_virtual_destructor, int&>(false)) ); |
VERIFY( (test_category<has_virtual_destructor, EnumType>(false)) ); |
VERIFY( (test_category<has_virtual_destructor, ClassType>(false)) ); |
VERIFY( (test_category<has_virtual_destructor, DerivedType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/has_virtual_destructor/requirements/typedefs.cc
0,0 → 1,35
// 2007-04-08 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2007, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::has_virtual_destructor<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; |
} |
/has_virtual_destructor/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct has_virtual_destructor<test_type>; |
} |
} |
/is_class/value.cc
0,0 → 1,60
// 2007-04-08 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2007, 2009 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/>. |
|
// 4.5.1 Primary type categories |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_class; |
using namespace __gnu_test; |
|
// Positive tests. |
VERIFY( (test_category<is_class, ClassType>(true)) ); |
VERIFY( (test_category<is_class, DerivedType>(true)) ); |
VERIFY( (test_category<is_class, ConvType>(true)) ); |
VERIFY( (test_category<is_class, AbstractClass>(true)) ); |
VERIFY( (test_category<is_class, PolymorphicClass>(true)) ); |
VERIFY( (test_category<is_class, DerivedPolymorphic>(true)) ); |
|
// Negative tests. |
VERIFY( (test_category<is_class, UnionType>(false)) ); |
VERIFY( (test_category<is_class, void>(false)) ); |
VERIFY( (test_category<is_class, int>(false)) ); |
VERIFY( (test_category<is_class, float>(false)) ); |
VERIFY( (test_category<is_class, int[2]>(false)) ); |
VERIFY( (test_category<is_class, int*>(false)) ); |
VERIFY( (test_category<is_class, int(*)(int)>(false)) ); |
VERIFY( (test_category<is_class, float&>(false)) ); |
VERIFY( (test_category<is_class, float(&)(float)>(false)) ); |
VERIFY( (test_category<is_class, int (ClassType::*)>(false)) ); |
VERIFY( (test_category<is_class, int (ClassType::*) (int)>(false)) ); |
VERIFY( (test_category<is_class, int (int)>(false)) ); |
VERIFY( (test_category<is_class, EnumType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_class/requirements/typedefs.cc
0,0 → 1,35
// 2007-04-08 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2007, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_class<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; |
} |
/is_class/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_class<test_type>; |
} |
} |
/has_nothrow_constructor/value.cc
0,0 → 1,57
// 2004-12-29 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2005, 2006, 2007, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::has_nothrow_constructor; |
using namespace __gnu_test; |
|
VERIFY( (test_category<has_nothrow_constructor, void>(true)) ); |
VERIFY( (test_category<has_nothrow_constructor, int>(true)) ); |
VERIFY( (test_category<has_nothrow_constructor, float>(true)) ); |
VERIFY( (test_category<has_nothrow_constructor, EnumType>(true)) ); |
VERIFY( (test_category<has_nothrow_constructor, int*>(true)) ); |
VERIFY( (test_category<has_nothrow_constructor, int(*)(int)>(true)) ); |
VERIFY( (test_category<has_nothrow_constructor, int (ClassType::*)>(true)) ); |
VERIFY( (test_category<has_nothrow_constructor, |
int (ClassType::*) (int)>(true)) ); |
VERIFY( (test_category<has_nothrow_constructor, int[2]>(true)) ); |
VERIFY( (test_category<has_nothrow_constructor, float[][3]>(true)) ); |
VERIFY( (test_category<has_nothrow_constructor, EnumType[2][3][4]>(true)) ); |
VERIFY( (test_category<has_nothrow_constructor, int*[3]>(true)) ); |
VERIFY( (test_category<has_nothrow_constructor, int(*[][2])(int)>(true)) ); |
VERIFY( (test_category<has_nothrow_constructor, |
int (ClassType::*[2][3])>(true)) ); |
VERIFY( (test_category<has_nothrow_constructor, |
int (ClassType::*[][2][3]) (int)>(true)) ); |
VERIFY( (test_category<has_nothrow_constructor, ClassType>(true)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/has_nothrow_constructor/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-29 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::has_nothrow_constructor<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; |
} |
/has_nothrow_constructor/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct has_nothrow_constructor<test_type>; |
} |
} |
/is_polymorphic/value.cc
0,0 → 1,54
// 2005-03-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2006, 2007, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <iostream> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_polymorphic; |
using namespace __gnu_test; |
|
// Positive tests. |
VERIFY( (test_category<is_polymorphic, PolymorphicClass>(true)) ); |
VERIFY( (test_category<is_polymorphic, DerivedPolymorphic>(true)) ); |
VERIFY( (test_category<is_polymorphic, AbstractClass>(true)) ); |
VERIFY( (test_category<is_polymorphic, VirtualDestructorClass>(true)) ); |
VERIFY( (test_category<is_polymorphic, std::iostream>(true)) ); |
VERIFY( (test_category<is_polymorphic, std::streambuf>(true)) ); |
|
// Negative tests. |
VERIFY( (test_category<is_polymorphic, void>(false)) ); |
VERIFY( (test_category<is_polymorphic, int (int)>(false)) ); |
VERIFY( (test_category<is_polymorphic, int&>(false)) ); |
VERIFY( (test_category<is_polymorphic, EnumType>(false)) ); |
VERIFY( (test_category<is_polymorphic, ClassType>(false)) ); |
VERIFY( (test_category<is_polymorphic, DerivedType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_polymorphic/requirements/typedefs.cc
0,0 → 1,35
// 2005-03-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_polymorphic<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; |
} |
/is_polymorphic/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_polymorphic<test_type>; |
} |
} |
/is_polymorphic/24809.cc
0,0 → 1,26
// { dg-do compile } |
|
// Copyright (C) 2005, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <exception> |
|
// libstdc++/24809 |
static const bool b = std::tr1::is_polymorphic<std::exception>::value; |
/is_scalar/value.cc
0,0 → 1,48
// 2004-12-25 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.2 Composite type traits |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_scalar; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_scalar, int>(true)) ); |
VERIFY( (test_category<is_scalar, float>(true)) ); |
VERIFY( (test_category<is_scalar, EnumType>(true)) ); |
VERIFY( (test_category<is_scalar, int*>(true)) ); |
VERIFY( (test_category<is_scalar, int(*)(int)>(true)) ); |
VERIFY( (test_category<is_scalar, int (ClassType::*)>(true)) ); |
VERIFY( (test_category<is_scalar, int (ClassType::*) (int)>(true)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_scalar, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_scalar/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-25 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_scalar<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; |
} |
/is_scalar/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_scalar<test_type>; |
} |
} |
/alignment_of/value.cc
0,0 → 1,44
// 2005-01-11 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::alignment_of; |
using namespace __gnu_test; |
|
VERIFY( (test_property<alignment_of, char>(__alignof__(char))) ); |
VERIFY( (test_property<alignment_of, short>(__alignof__(short))) ); |
VERIFY( (test_property<alignment_of, int>(__alignof__(int))) ); |
VERIFY( (test_property<alignment_of, double>(__alignof__(double))) ); |
VERIFY( (test_property<alignment_of, int[4]>(__alignof__(int[4]))) ); |
VERIFY( (test_property<alignment_of, ClassType>(__alignof__(ClassType))) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/alignment_of/requirements/typedefs.cc
0,0 → 1,35
// 2005-01-11 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::alignment_of<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; |
} |
/alignment_of/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct alignment_of<test_type>; |
} |
} |
/is_member_pointer/value.cc
0,0 → 1,55
// 2004-12-24 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.2 Composite type traits |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_member_pointer; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_member_pointer, int (ClassType::*)>(true)) ); |
VERIFY( (test_category<is_member_pointer, const int (ClassType::*)>(true)) ); |
VERIFY( (test_category<is_member_pointer, ClassType (ClassType::*)>(true)) ); |
|
VERIFY( (test_category<is_member_pointer, |
int (ClassType::*) (int)>(true)) ); |
VERIFY( (test_category<is_member_pointer, |
int (ClassType::*) (int) const>(true)) ); |
VERIFY( (test_category<is_member_pointer, |
int (ClassType::*) (float, ...)>(true)) ); |
VERIFY( (test_category<is_member_pointer, |
ClassType (ClassType::*) (ClassType)>(true)) ); |
VERIFY( (test_category<is_member_pointer, |
float (ClassType::*) (int, float, int[], int&)>(true)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_member_pointer, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_member_pointer/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-24 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_member_pointer<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; |
} |
/is_member_pointer/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_member_pointer<test_type>; |
} |
} |
/is_signed/value.cc
0,0 → 1,61
// 2005-01-24 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_signed; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_signed, void>(false)) ); |
|
VERIFY( (test_category<is_signed, char>(false)) ); |
VERIFY( (test_category<is_signed, signed char>(true)) ); |
VERIFY( (test_category<is_signed, unsigned char>(false)) ); |
#ifdef _GLIBCXX_USE_WCHAR_T |
VERIFY( (test_category<is_signed, wchar_t>(false)) ); |
#endif |
VERIFY( (test_category<is_signed, short>(true)) ); |
VERIFY( (test_category<is_signed, unsigned short>(false)) ); |
VERIFY( (test_category<is_signed, int>(true)) ); |
VERIFY( (test_category<is_signed, unsigned int>(false)) ); |
VERIFY( (test_category<is_signed, long>(true)) ); |
VERIFY( (test_category<is_signed, unsigned long>(false)) ); |
VERIFY( (test_category<is_signed, long long>(true)) ); |
VERIFY( (test_category<is_signed, unsigned long long>(false)) ); |
|
VERIFY( (test_category<is_signed, float>(false)) ); |
VERIFY( (test_category<is_signed, double>(false)) ); |
VERIFY( (test_category<is_signed, long double>(false)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_signed, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_signed/requirements/typedefs.cc
0,0 → 1,35
// 2005-01-24 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_signed<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; |
} |
/is_signed/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_signed<test_type>; |
} |
} |
/extent/value.cc
0,0 → 1,56
// 2004-12-12 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::extent; |
using namespace __gnu_test; |
|
VERIFY( (test_property<extent, int, 0>(0)) ); |
VERIFY( (test_property<extent, int[2], 0>(2)) ); |
VERIFY( (test_property<extent, int[2][4], 0>(2)) ); |
VERIFY( (test_property<extent, int[][4], 0>(0)) ); |
VERIFY( (extent<int, 1>::value == 0) ); |
VERIFY( (extent<int[2], 1>::value == 0) ); |
VERIFY( (extent<int[2][4], 1>::value == 4) ); |
VERIFY( (extent<int[][4], 1>::value == 4) ); |
VERIFY( (extent<int[10][4][6][8][12][2], 4>::value == 12) ); |
VERIFY( (test_property<extent, ClassType, 0>(0)) ); |
VERIFY( (test_property<extent, ClassType[2], 0>(2)) ); |
VERIFY( (test_property<extent, ClassType[2][4], 0>(2)) ); |
VERIFY( (test_property<extent, ClassType[][4], 0>(0)) ); |
VERIFY( (extent<ClassType, 1>::value == 0) ); |
VERIFY( (extent<ClassType[2], 1>::value == 0) ); |
VERIFY( (extent<ClassType[2][4], 1>::value == 4) ); |
VERIFY( (extent<ClassType[][4], 1>::value == 4) ); |
VERIFY( (extent<ClassType[10][4][6][8][12][2], 4>::value == 12) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/extent/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-12 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::extent<int, 1> 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; |
} |
/extent/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct extent<test_type, 2>; |
} |
} |
/is_member_function_pointer/value.cc
0,0 → 1,60
// 2004-12-24 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.1 Primary type categories |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_member_function_pointer; |
using namespace __gnu_test; |
|
// Positive tests. |
VERIFY( (test_category<is_member_function_pointer, |
int (ClassType::*) (int)>(true)) ); |
VERIFY( (test_category<is_member_function_pointer, |
int (ClassType::*) (int) const>(true)) ); |
VERIFY( (test_category<is_member_function_pointer, |
int (ClassType::*) (float, ...)>(true)) ); |
VERIFY( (test_category<is_member_function_pointer, |
ClassType (ClassType::*) (ClassType)>(true)) ); |
VERIFY( (test_category<is_member_function_pointer, |
float (ClassType::*) (int, float, int[], int&)>(true)) ); |
|
// Negative tests. |
VERIFY( (test_category<is_member_function_pointer, |
int (ClassType::*)>(false)) ); |
VERIFY( (test_category<is_member_function_pointer, |
const int (ClassType::*)>(false)) ); |
VERIFY( (test_category<is_member_function_pointer, |
ClassType (ClassType::*)>(false)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_member_function_pointer, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_member_function_pointer/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-24 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_member_function_pointer<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; |
} |
/is_member_function_pointer/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_member_function_pointer<test_type>; |
} |
} |
/is_unsigned/value.cc
0,0 → 1,61
// 2005-01-24 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_unsigned; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_unsigned, void>(false)) ); |
|
VERIFY( (test_category<is_unsigned, char>(false)) ); |
VERIFY( (test_category<is_unsigned, signed char>(false)) ); |
VERIFY( (test_category<is_unsigned, unsigned char>(true)) ); |
#ifdef _GLIBCXX_USE_WCHAR_T |
VERIFY( (test_category<is_unsigned, wchar_t>(false)) ); |
#endif |
VERIFY( (test_category<is_unsigned, short>(false)) ); |
VERIFY( (test_category<is_unsigned, unsigned short>(true)) ); |
VERIFY( (test_category<is_unsigned, int>(false)) ); |
VERIFY( (test_category<is_unsigned, unsigned int>(true)) ); |
VERIFY( (test_category<is_unsigned, long>(false)) ); |
VERIFY( (test_category<is_unsigned, unsigned long>(true)) ); |
VERIFY( (test_category<is_unsigned, long long>(false)) ); |
VERIFY( (test_category<is_unsigned, unsigned long long>(true)) ); |
|
VERIFY( (test_category<is_unsigned, float>(false)) ); |
VERIFY( (test_category<is_unsigned, double>(false)) ); |
VERIFY( (test_category<is_unsigned, long double>(false)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_unsigned, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_unsigned/requirements/typedefs.cc
0,0 → 1,35
// 2005-01-24 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2005, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_unsigned<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; |
} |
/is_unsigned/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_unsigned<test_type>; |
} |
} |
/is_array/value.cc
0,0 → 1,53
// 2004-12-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.1 Primary type categories |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_array; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_array, int[2]>(true)) ); |
VERIFY( (test_category<is_array, int[]>(true)) ); |
VERIFY( (test_category<is_array, int[2][3]>(true)) ); |
VERIFY( (test_category<is_array, int[][3]>(true)) ); |
VERIFY( (test_category<is_array, float*[2]>(true)) ); |
VERIFY( (test_category<is_array, float*[]>(true)) ); |
VERIFY( (test_category<is_array, float*[2][3]>(true)) ); |
VERIFY( (test_category<is_array, float*[][3]>(true)) ); |
VERIFY( (test_category<is_array, ClassType[2]>(true)) ); |
VERIFY( (test_category<is_array, ClassType[]>(true)) ); |
VERIFY( (test_category<is_array, ClassType[2][3]>(true)) ); |
VERIFY( (test_category<is_array, ClassType[][3]>(true)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_array, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_array/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-03 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_array<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; |
} |
/is_array/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_array<test_type>; |
} |
} |
/has_trivial_assign/value.cc
0,0 → 1,54
// 2004-12-30 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2005, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::has_trivial_assign; |
using namespace __gnu_test; |
|
VERIFY( (test_category<has_trivial_assign, void>(true)) ); |
VERIFY( (test_category<has_trivial_assign, int>(true)) ); |
VERIFY( (test_category<has_trivial_assign, float>(true)) ); |
VERIFY( (test_category<has_trivial_assign, EnumType>(true)) ); |
VERIFY( (test_category<has_trivial_assign, int*>(true)) ); |
VERIFY( (test_category<has_trivial_assign, int(*)(int)>(true)) ); |
VERIFY( (test_category<has_trivial_assign, int (ClassType::*)>(true)) ); |
VERIFY( (test_category<has_trivial_assign, int (ClassType::*) (int)>(true)) ); |
VERIFY( (test_category<has_trivial_assign, int[2]>(true)) ); |
VERIFY( (test_category<has_trivial_assign, float[][3]>(true)) ); |
VERIFY( (test_category<has_trivial_assign, EnumType[2][3][4]>(true)) ); |
VERIFY( (test_category<has_trivial_assign, int*[3]>(true)) ); |
VERIFY( (test_category<has_trivial_assign, int(*[][2])(int)>(true)) ); |
VERIFY( (test_category<has_trivial_assign, int (ClassType::*[2][3])>(true)) ); |
VERIFY( (test_category<has_trivial_assign, |
int (ClassType::*[][2][3]) (int)>(true)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/has_trivial_assign/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-30 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::has_trivial_assign<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; |
} |
/has_trivial_assign/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct has_trivial_assign<test_type>; |
} |
} |
/has_trivial_constructor/value.cc
0,0 → 1,57
// 2004-12-26 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2005, 2006, 2007, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::has_trivial_constructor; |
using namespace __gnu_test; |
|
VERIFY( (test_category<has_trivial_constructor, void>(true)) ); |
VERIFY( (test_category<has_trivial_constructor, int>(true)) ); |
VERIFY( (test_category<has_trivial_constructor, float>(true)) ); |
VERIFY( (test_category<has_trivial_constructor, EnumType>(true)) ); |
VERIFY( (test_category<has_trivial_constructor, int*>(true)) ); |
VERIFY( (test_category<has_trivial_constructor, int(*)(int)>(true)) ); |
VERIFY( (test_category<has_trivial_constructor, int (ClassType::*)>(true)) ); |
VERIFY( (test_category<has_trivial_constructor, |
int (ClassType::*) (int)>(true)) ); |
VERIFY( (test_category<has_trivial_constructor, int[2]>(true)) ); |
VERIFY( (test_category<has_trivial_constructor, float[][3]>(true)) ); |
VERIFY( (test_category<has_trivial_constructor, EnumType[2][3][4]>(true)) ); |
VERIFY( (test_category<has_trivial_constructor, int*[3]>(true)) ); |
VERIFY( (test_category<has_trivial_constructor, int(*[][2])(int)>(true)) ); |
VERIFY( (test_category<has_trivial_constructor, |
int (ClassType::*[2][3])>(true)) ); |
VERIFY( (test_category<has_trivial_constructor, |
int (ClassType::*[][2][3]) (int)>(true)) ); |
VERIFY( (test_category<has_trivial_constructor, ClassType>(true)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/has_trivial_constructor/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-26 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::has_trivial_constructor<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; |
} |
/has_trivial_constructor/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct has_trivial_constructor<test_type>; |
} |
} |
/is_volatile/value.cc
0,0 → 1,49
// 2004-12-07 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.3 Type properties |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_volatile; |
using namespace __gnu_test; |
|
// Positive tests. |
VERIFY( (test_property<is_volatile, volatile int>(true)) ); |
VERIFY( (test_property<is_volatile, const volatile int>(true)) ); |
VERIFY( (test_property<is_volatile, vClassType>(true)) ); |
VERIFY( (test_property<is_volatile, cvClassType>(true)) ); |
|
// Negative tests. |
VERIFY( (test_property<is_volatile, int>(false)) ); |
VERIFY( (test_property<is_volatile, const int>(false)) ); |
VERIFY( (test_property<is_volatile, ClassType>(false)) ); |
VERIFY( (test_property<is_volatile, cClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_volatile/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-07 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_volatile<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; |
} |
/is_volatile/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_volatile<test_type>; |
} |
} |
/headers/type_traits/types_std_tr1.cc
0,0 → 1,26
// { dg-do compile } |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace gnu |
{ |
using std::tr1::true_type; |
using std::tr1::false_type; |
} |
/headers/type_traits/synopsis.cc
0,0 → 1,103
// { dg-do compile } |
|
// 2007-02-04 Benjamin Kosnik <bkoz@redhat.com> |
// |
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std { |
namespace tr1 { |
|
// [4.3] helper class: |
template <class T, T v> struct integral_constant; |
typedef integral_constant<bool, true> true_type; |
typedef integral_constant<bool, false> false_type; |
|
// [4.5.1] primary type categories: |
template <class T> struct is_void; |
template <class T> struct is_integral; |
template <class T> struct is_floating_point; |
template <class T> struct is_array; |
template <class T> struct is_pointer; |
template <class T> struct is_reference; |
template <class T> struct is_member_object_pointer; |
template <class T> struct is_member_function_pointer; |
template <class T> struct is_enum; |
template <class T> struct is_union; |
template <class T> struct is_class; |
template <class T> struct is_function; |
|
// [4.5.2] composite type categories: |
template <class T> struct is_arithmetic; |
template <class T> struct is_fundamental; |
template <class T> struct is_object; |
template <class T> struct is_scalar; |
template <class T> struct is_compound; |
template <class T> struct is_member_pointer; |
|
// [4.5.3] type properties: |
template <class T> struct is_const; |
template <class T> struct is_volatile; |
template <class T> struct is_pod; |
template <class T> struct is_empty; |
template <class T> struct is_polymorphic; |
template <class T> struct is_abstract; |
template <class T> struct has_trivial_constructor; |
template <class T> struct has_trivial_copy; |
template <class T> struct has_trivial_assign; |
template <class T> struct has_trivial_destructor; |
template <class T> struct has_nothrow_constructor; |
template <class T> struct has_nothrow_copy; |
template <class T> struct has_nothrow_assign; |
template <class T> struct has_virtual_destructor; |
template <class T> struct is_signed; |
template <class T> struct is_unsigned; |
template <class T> struct alignment_of; |
template <class T> struct rank; |
template <class T, unsigned I> struct extent; |
|
// [4.6] type relations: |
template <class T, class U> struct is_same; |
template <class Base, class Derived> struct is_base_of; |
template <class From, class To> struct is_convertible; |
|
// [4.7.1] const-volatile modifications: |
template <class T> struct remove_const; |
template <class T> struct remove_volatile; |
template <class T> struct remove_cv; |
template <class T> struct add_const; |
template <class T> struct add_volatile; |
template <class T> struct add_cv; |
|
// [4.7.2] reference modifications: |
template <class T> struct remove_reference; |
template <class T> struct add_reference; |
|
// [4.7.3] array modifications: |
template <class T> struct remove_extent; |
template <class T> struct remove_all_extents; |
|
// [4.7.4] pointer modifications: |
template <class T> struct remove_pointer; |
template <class T> struct add_pointer; |
|
// [4.8] other transformations: |
template <std::size_t Len, std::size_t Align> struct aligned_storage; |
} // namespace tr1 |
} // namespace std |
/is_pointer/value.cc
0,0 → 1,44
// 2004-12-12 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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/>. |
|
// 4.5.1 Primary type categories |
|
#include <tr1/type_traits> |
#include <testsuite_hooks.h> |
#include <testsuite_tr1.h> |
|
void test01() |
{ |
bool test __attribute__((unused)) = true; |
using std::tr1::is_pointer; |
using namespace __gnu_test; |
|
VERIFY( (test_category<is_pointer, int*>(true)) ); |
VERIFY( (test_category<is_pointer, ClassType*>(true)) ); |
VERIFY( (test_category<is_pointer, int(*)(int)>(true)) ); |
|
// Sanity check. |
VERIFY( (test_category<is_pointer, ClassType>(false)) ); |
} |
|
int main() |
{ |
test01(); |
return 0; |
} |
/is_pointer/requirements/typedefs.cc
0,0 → 1,35
// 2004-12-12 Paolo Carlini <pcarlini@suse.de> |
// |
// Copyright (C) 2004, 2009 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 tr1/type_traits with NO OTHER INCLUDES. |
|
#include <tr1/type_traits> |
|
// { dg-do compile } |
|
void test01() |
{ |
// Check for required typedefs |
typedef std::tr1::is_pointer<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; |
} |
/is_pointer/requirements/explicit_instantiation.cc
0,0 → 1,33
// { dg-do compile } |
// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> |
|
// Copyright (C) 2007, 2009 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 <tr1/type_traits> |
|
namespace std |
{ |
namespace tr1 |
{ |
typedef short test_type; |
template struct is_pointer<test_type>; |
} |
} |