From f706cf1831e57964262a6ddd5d8bf96c7430b9af Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Fri, 5 Nov 2010 22:30:54 +0000 Subject: [PATCH] user.cfg.in: Remove tr1_impl headers. 2010-11-05 Benjamin Kosnik * doc/doxygen/user.cfg.in: Remove tr1_impl headers. * testsuite/tr1/4_metaprogramming/integral_constant/requirements/ constexpr_data.cc: New. * testsuite/util/testsuite_tr1.h (LType, LTypeDerived, NLType): New. * testsuite/20_util/is_literal_type/value.cc: New. * testsuite/20_util/is_literal_type/requirements/typedefs.cc: Name. * testsuite/20_util/is_literal_type/requirements/ explicit_instantiation.cc: New. From-SVN: r166381 --- libstdc++-v3/ChangeLog | 13 +++++ libstdc++-v3/doc/doxygen/user.cfg.in | 18 ++----- .../requirements/explicit_instantiation.cc | 30 +++++++++++ .../is_literal_type/requirements/typedefs.cc | 36 +++++++++++++ .../20_util/is_literal_type/value.cc | 54 +++++++++++++++++++ .../requirements/constexpr_data.cc | 52 ++++++++++++++++++ libstdc++-v3/testsuite/util/testsuite_tr1.h | 33 ++++++++++-- 7 files changed, 219 insertions(+), 17 deletions(-) create mode 100644 libstdc++-v3/testsuite/20_util/is_literal_type/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_literal_type/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_literal_type/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/constexpr_data.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8ea46f0847d..ad8b235e049 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,16 @@ +2010-11-05 Benjamin Kosnik + + * doc/doxygen/user.cfg.in: Remove tr1_impl headers. + + * testsuite/tr1/4_metaprogramming/integral_constant/requirements/ + constexpr_data.cc: New. + + * testsuite/util/testsuite_tr1.h (LType, LTypeDerived, NLType): New. + * testsuite/20_util/is_literal_type/value.cc: New. + * testsuite/20_util/is_literal_type/requirements/typedefs.cc: Name. + * testsuite/20_util/is_literal_type/requirements/ + explicit_instantiation.cc: New. + 2010-11-04 Paolo Carlini PR libstdc++/46303 diff --git a/libstdc++-v3/doc/doxygen/user.cfg.in b/libstdc++-v3/doc/doxygen/user.cfg.in index 8550aa54bf1..ed5c5a14810 100644 --- a/libstdc++-v3/doc/doxygen/user.cfg.in +++ b/libstdc++-v3/doc/doxygen/user.cfg.in @@ -586,6 +586,7 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \ @srcdir@/libsupc++/cxxabi.h \ @srcdir@/libsupc++/cxxabi-forced.h \ @srcdir@/libsupc++/exception \ + @srcdir@/libsupc++/exception_defines.h \ @srcdir@/libsupc++/exception_ptr.h \ @srcdir@/libsupc++/initializer_list \ @srcdir@/libsupc++/nested_exception.h \ @@ -665,6 +666,7 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \ include/backward/strstream \ include/debug/bitset \ include/debug/deque \ + include/debug/forward_list \ include/debug/list \ include/debug/map \ include/debug/set \ @@ -674,6 +676,7 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \ include/debug/vector \ include/profile/bitset \ include/profile/deque \ + include/profile/forward_list \ include/profile/list \ include/profile/map \ include/profile/set \ @@ -707,20 +710,6 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \ include/tr1/ctime \ include/tr1/cwchar \ include/tr1/cwctype \ - include/tr1_impl/array \ - include/tr1_impl/cctype \ - include/tr1_impl/cfenv \ - include/tr1_impl/cinttypes \ - include/tr1_impl/cmath \ - include/tr1_impl/complex \ - include/tr1_impl/cstdint \ - include/tr1_impl/cstdio \ - include/tr1_impl/cstdlib \ - include/tr1_impl/cwchar \ - include/tr1_impl/cwctype \ - include/tr1_impl/type_traits \ - include/tr1_impl/utility \ - include/tr1_impl \ include/decimal/decimal \ include/ \ include/@host_alias@/bits \ @@ -728,6 +717,7 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \ include/bits \ include/debug \ include/parallel \ + include/precompiled \ include/profile \ include/profile/impl \ include/ext \ diff --git a/libstdc++-v3/testsuite/20_util/is_literal_type/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_literal_type/requirements/explicit_instantiation.cc new file mode 100644 index 00000000000..6669a1e89f8 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_literal_type/requirements/explicit_instantiation.cc @@ -0,0 +1,30 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } +// 2010-02-21 Paolo Carlini + +// Copyright (C) 2010 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 +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_literal_type; +} diff --git a/libstdc++-v3/testsuite/20_util/is_literal_type/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_literal_type/requirements/typedefs.cc new file mode 100644 index 00000000000..25bc88f29fb --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_literal_type/requirements/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// 2010-02-21 Paolo Carlini +// +// Copyright (C) 2010 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 +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::is_literal_type 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; +} diff --git a/libstdc++-v3/testsuite/20_util/is_literal_type/value.cc b/libstdc++-v3/testsuite/20_util/is_literal_type/value.cc new file mode 100644 index 00000000000..77a6902b768 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_literal_type/value.cc @@ -0,0 +1,54 @@ +// { dg-options "-std=gnu++0x" } +// 2010-03-23 Paolo Carlini +// +// Copyright (C) 2010 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 +// . + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::is_literal_type; + using namespace __gnu_test; + + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/constexpr_data.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/constexpr_data.cc new file mode 100644 index 00000000000..52497e1f443 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/constexpr_data.cc @@ -0,0 +1,52 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 +// . + +#include +#include + +namespace __gnu_test +{ + struct constexpr_member_data + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v __attribute__((unused)) (_Ttesttype::value); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_data test; + test.operator()>(); + test.operator()>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/util/testsuite_tr1.h b/libstdc++-v3/testsuite/util/testsuite_tr1.h index 5aac18292bb..6a48a309e18 100644 --- a/libstdc++-v3/testsuite/util/testsuite_tr1.h +++ b/libstdc++-v3/testsuite/util/testsuite_tr1.h @@ -57,7 +57,7 @@ namespace __gnu_test // For testing tr1/type_traits/extent, which has a second template // parameter. template class Property, - typename Type, unsigned Uint> + typename Type, unsigned Uint> bool test_property(typename Property::value_type value) { @@ -80,7 +80,7 @@ namespace __gnu_test #endif template class Relationship, - typename Type1, typename Type2> + typename Type1, typename Type2> bool test_relationship(bool value) { @@ -188,6 +188,33 @@ namespace __gnu_test int j; }; +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + struct LType // literal type + { + int _M_i; + + constexpr LType(int __i) : _M_i(__i) { } + }; + + struct LTypeDerived : public LType + { + constexpr LTypeDerived(int __i) : LType(__i) { } + }; + + struct NLType // not literal type + { + int _M_i; + + NLType() : _M_i(0) { } + + constexpr NLType(int __i) : _M_i(__i) { } + + NLType(const NLType& __other) : _M_i(__other._M_i) { } + + ~NLType() { _M_i = 0; } + }; +#endif + int truncate_float(float x) { return (int)x; } long truncate_double(double x) { return (long)x; } @@ -251,7 +278,7 @@ namespace __gnu_test // For use in 8_c_compatibility. template - typename __gnu_cxx::__enable_if::__value, + typename __gnu_cxx::__enable_if::__value, bool>::__type check_ret_type(T) { return true; }