From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- .../23_containers/array/requirements/citerators.cc | 30 ++++++++++++ .../array/requirements/constexpr_functions.cc | 54 ++++++++++++++++++++++ .../array/requirements/explicit_instantiation/1.cc | 23 +++++++++ .../array/requirements/explicit_instantiation/2.cc | 27 +++++++++++ .../array/requirements/explicit_instantiation/3.cc | 30 ++++++++++++ .../23_containers/array/requirements/fill.cc | 46 ++++++++++++++++++ .../23_containers/array/requirements/typedefs.cc | 25 ++++++++++ 7 files changed, 235 insertions(+) create mode 100644 libstdc++-v3/testsuite/23_containers/array/requirements/citerators.cc create mode 100644 libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_functions.cc create mode 100644 libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/1.cc create mode 100644 libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/2.cc create mode 100644 libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/3.cc create mode 100644 libstdc++-v3/testsuite/23_containers/array/requirements/fill.cc create mode 100644 libstdc++-v3/testsuite/23_containers/array/requirements/typedefs.cc (limited to 'libstdc++-v3/testsuite/23_containers/array/requirements') diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/citerators.cc new file mode 100644 index 000000000..c448a8419 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/citerators.cc @@ -0,0 +1,30 @@ +// { dg-options "-std=gnu++0x" } + +// 2007-10-15 Paolo Carlini + +// 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 +// . + +#include +#include + +int main() +{ + typedef std::array test_type; + __gnu_test::citerator test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_functions.cc new file mode 100644 index 000000000..ef8c5aac7 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_functions.cc @@ -0,0 +1,54 @@ +// { 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_functions + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr _Ttesttype a = { }; + constexpr auto v1 __attribute__((unused)) = a.size(); + constexpr auto v2 __attribute__((unused)) = a.max_size(); + constexpr auto v3 __attribute__((unused)) = a.empty(); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_functions test; + test.operator()>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/1.cc new file mode 100644 index 000000000..0e1044124 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/1.cc @@ -0,0 +1,23 @@ +// { dg-options "-std=gnu++0x" } +// { 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 +// . + +#include + +template class std::array; diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/2.cc new file mode 100644 index 000000000..aadf76b72 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/2.cc @@ -0,0 +1,27 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include +#include + +template class std::array<__gnu_test::NonDefaultConstructible, 3>; diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/3.cc new file mode 100644 index 000000000..9bd5bc9c0 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/3.cc @@ -0,0 +1,30 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// 2010-05-20 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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include +#include + +// libstdc++/41792 +template class std::array<__gnu_test::OverloadedAddress, 3>; diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/fill.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/fill.cc new file mode 100644 index 000000000..5586b7062 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/fill.cc @@ -0,0 +1,46 @@ +// { dg-options "-std=gnu++0x" } + +// 2008-06-13 Paolo Carlini +// +// 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 +// . + +#include +#include + +// DR 776. Undescribed assign function of std::array. +void test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 3; + typedef std::array array_type; + + array_type a = { { 0, 1, 2 } }; + const int value = 5; + + a.fill(value); + VERIFY( a[0] == value ); + VERIFY( a[1] == value ); + VERIFY( a[2] == value ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/typedefs.cc new file mode 100644 index 000000000..152988df7 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/typedefs.cc @@ -0,0 +1,25 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 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 +// . + +#include +#include + +// Check container for required typedefs. +__gnu_test::types > t; -- cgit v1.2.3