Index: ChangeLog =================================================================== --- ChangeLog (revision 178910) +++ ChangeLog (working copy) @@ -1,3 +1,59 @@ +2011-09-16 Paolo Carlini + + * testsuite/23_containers/array/comparison_operators/ + less_or_equal.cc: New. + * testsuite/23_containers/array/comparison_operators/ + greater_or_equal.cc: Likewise. + * testsuite/23_containers/array/comparison_operators/less.cc: Likewise. + * testsuite/23_containers/array/comparison_operators/equal.cc: Likewise. + * testsuite/23_containers/array/comparison_operators/not_equal.cc: + Likewise. + * testsuite/23_containers/array/comparison_operators/greater.cc: + Likewise. + * testsuite/23_containers/array/iterators/end_is_one_past.cc: Likewise. + * testsuite/23_containers/array/capacity/empty.cc: Likewise. + * testsuite/23_containers/array/capacity/max_size.cc: Likewise. + * testsuite/23_containers/array/capacity/size.cc: Likewise. + * testsuite/23_containers/array/tuple_interface/tuple_element.cc: + Likewise. + * testsuite/23_containers/array/tuple_interface/tuple_size.cc: + Likewise. + * testsuite/23_containers/array/element_access/at_out_of_range.cc: + Likewise. + * testsuite/23_containers/array/element_access/back.cc: Likewise. + * testsuite/23_containers/array/element_access/front.cc: Likewise. + * testsuite/23_containers/array/element_access/data.cc: Likewise. + * testsuite/23_containers/array/cons/aggregate_initialization.cc: + Likewise. + * testsuite/23_containers/array/requirements/zero_sized_arrays.cc: + Likewise. + * testsuite/23_containers/array/requirements/contiguous.cc: Likewise. + * testsuite/23_containers/array/requirements/member_swap.cc: Likewise. + * testsuite/23_containers/array/specialized_algorithms/swap.cc: + Likewise. + * testsuite/23_containers/array/constexpr_get.cc: Move... + * testsuite/23_containers/array/tuple_interface/constexpr_get.cc: + ... here. + * testsuite/23_containers/array/requirements/get.cc: Move... + * testsuite/23_containers/array/tuple_interface/get: ... here. + * testsuite/23_containers/array/at_neg.cc: Move... + * testsuite/23_containers/array/element_access: ... here. + * testsuite/23_containers/array/requirements/constexpr_functions.cc: + Move... + * testsuite/23_containers/array/capacity: ... here. + * testsuite/23_containers/array/requirements/ + constexpr_element_access.cc: Move... + * testsuite/23_containers/array/element_access: ... here. + + * testsuite/20_util/duration/cons/1_neg.cc: Avoid -Wall warnings. + * testsuite/20_util/tuple/creation_functions/constexpr.cc: Likewise. + * testsuite/20_util/pair/make_pair/constexpr.cc: Likewise. + * testsuite/20_util/time_point/nonmember/constexpr.cc: Likewise. + * testsuite/23_containers/bitset/operations/constexpr.cc: Likewise. + + * testsuite/20_util/duration/cons/1_neg.cc: Discard bogus warning. + * testsuite/20_util/forward/1_neg.cc: Likewise. + 2011-09-15 Paolo Carlini * include/std/tuple (make_tuple, forward_as_tuple): Declare constexpr. Index: testsuite/23_containers/bitset/operations/constexpr.cc =================================================================== --- testsuite/23_containers/bitset/operations/constexpr.cc (revision 178910) +++ testsuite/23_containers/bitset/operations/constexpr.cc (working copy) @@ -26,15 +26,15 @@ typedef std::_Base_bitset<6> bitset_base; constexpr bitset_base base = bitset_base(); - constexpr auto r1 = base._M_getword(2); + constexpr auto r1 __attribute__((unused)) = base._M_getword(2); // constexpr auto r2 = base._M_getdata(); // error, pointer to this - auto r2 = base._M_getdata(); - constexpr auto r3 = base._M_hiword(); + auto r2 __attribute__((unused)) = base._M_getdata(); + constexpr auto r3 __attribute__((unused)) = base._M_hiword(); // bitset operators typedef std::bitset<6> bitset_type; constexpr bitset_type a = bitset_type(); - constexpr auto v = a[0]; + constexpr auto v __attribute__((unused)) = a[0]; return 0; } Index: testsuite/23_containers/array/at_neg.cc =================================================================== --- testsuite/23_containers/array/at_neg.cc (revision 178910) +++ testsuite/23_containers/array/at_neg.cc (working copy) @@ -1,31 +0,0 @@ -// { dg-do run { xfail *-*-* } } -// { dg-options "-std=gnu++0x" } - -// Copyright (C) 2011 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 Pred 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 - -int main() -{ - // Expected behavior is to either throw and have the uncaught - // exception end up in a terminate handler which eventually exits, - // or abort. (Depending on -fno-exceptions.) - constexpr std::array a{{1, 2, 3}}; - auto i = a.at(4); - return 0; -} Index: testsuite/23_containers/array/cons/aggregate_initialization.cc =================================================================== --- testsuite/23_containers/array/cons/aggregate_initialization.cc (revision 0) +++ testsuite/23_containers/array/cons/aggregate_initialization.cc (revision 0) @@ -0,0 +1,38 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } +// +// Copyright (C) 2011 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 + +void +test01() +{ + typedef std::array array_type; + + array_type a = { { 0, 1, 2, 3, 4 } }; + array_type b = { { 0, 1, 2, 3 } }; + + a = b; +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/requirements/constexpr_functions.cc =================================================================== --- testsuite/23_containers/array/requirements/constexpr_functions.cc (revision 178910) +++ testsuite/23_containers/array/requirements/constexpr_functions.cc (working copy) @@ -1,53 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=gnu++0x" } - -// Copyright (C) 2010, 2011 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 - -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; -} Index: testsuite/23_containers/array/requirements/zero_sized_arrays.cc =================================================================== --- testsuite/23_containers/array/requirements/zero_sized_arrays.cc (revision 0) +++ testsuite/23_containers/array/requirements/zero_sized_arrays.cc (revision 0) @@ -0,0 +1,59 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 0; + typedef std::array array_type; + + // 1: ? + array_type a = { }; + + // 2 + array_type b; + + // 3 + // begin() == end() + VERIFY( a.begin() == a.end() ); + VERIFY( b.begin() == b.end() ); + + // 4: ? + // begin() == end() == unique value. + { + typedef std::array array_type1; + typedef std::array array_type2; + array_type1 one; + array_type2 two; + void* v1 = one.begin(); + void* v2 = two.begin(); + VERIFY( v1 != v2 ); + } +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/requirements/get.cc =================================================================== --- testsuite/23_containers/array/requirements/get.cc (revision 178910) +++ testsuite/23_containers/array/requirements/get.cc (working copy) @@ -1,31 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=gnu++0x" } - -// 2011-05-16 Paolo Carlini -// -// Copyright (C) 2011 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 - -void test01() -{ - std::array a; - - int&& aone __attribute__((unused)) = std::get<0>(std::move(a)); - int&& atwo __attribute__((unused)) = std::get<1>(std::move(a)); -} Index: testsuite/23_containers/array/requirements/constexpr_element_access.cc =================================================================== --- testsuite/23_containers/array/requirements/constexpr_element_access.cc (revision 178910) +++ testsuite/23_containers/array/requirements/constexpr_element_access.cc (working copy) @@ -1,31 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=gnu++0x" } - -// Copyright (C) 2011 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 - -int main() -{ - // array - typedef std::array array_type; - constexpr array_type a = { 0, 55, 66, 99, 4115, 2 }; - constexpr auto v1 = a[1]; - constexpr auto v2 = a.at(2); - return 0; -} Index: testsuite/23_containers/array/requirements/contiguous.cc =================================================================== --- testsuite/23_containers/array/requirements/contiguous.cc (revision 0) +++ testsuite/23_containers/array/requirements/contiguous.cc (revision 0) @@ -0,0 +1,43 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 5; + typedef std::array array_type; + array_type a = { { 0, 1, 2, 3, 4 } }; + + // &a[n] == &a[0] + n for all 0 <= n < N. + for (size_t i = 0; i < len; ++i) + { + VERIFY( &a[i] == &a[0] + i ); + } +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/requirements/member_swap.cc =================================================================== --- testsuite/23_containers/array/requirements/member_swap.cc (revision 0) +++ testsuite/23_containers/array/requirements/member_swap.cc (revision 0) @@ -0,0 +1,46 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 5; + typedef std::array array_type; + + array_type a = { { 0, 1, 2, 3, 4 } }; + const array_type a_ref = a; + + array_type b = { { 4, 3, 2, 1, 0 } }; + const array_type b_ref = b; + + a.swap(b); + VERIFY( a == b_ref ); + VERIFY( b == a_ref ); +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/specialized_algorithms/swap.cc =================================================================== --- testsuite/23_containers/array/specialized_algorithms/swap.cc (revision 0) +++ testsuite/23_containers/array/specialized_algorithms/swap.cc (revision 0) @@ -0,0 +1,46 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 5; + typedef std::array array_type; + + array_type a = { { 0, 1, 2, 3, 4 } }; + const array_type a_ref = a; + + array_type b = { { 4, 3, 2, 1, 0 } }; + const array_type b_ref = b; + + std::swap(a, b); + VERIFY( a == b_ref ); + VERIFY( b == a_ref ); +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/constexpr_get.cc =================================================================== --- testsuite/23_containers/array/constexpr_get.cc (revision 178910) +++ testsuite/23_containers/array/constexpr_get.cc (working copy) @@ -1,30 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// { dg-do compile } - -// Copyright (C) 2011 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 -// . - -// Tuple - -#include - -std::array ai; -const std::array cai(ai); - -constexpr const int& cri = std::get<0>(cai); -constexpr int& ri = std::get<0>(ai); -constexpr int&& rri = std::get<0>(std::move(ai)); Index: testsuite/23_containers/array/comparison_operators/less_or_equal.cc =================================================================== --- testsuite/23_containers/array/comparison_operators/less_or_equal.cc (revision 0) +++ testsuite/23_containers/array/comparison_operators/less_or_equal.cc (revision 0) @@ -0,0 +1,41 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + const size_t len = 5; + typedef std::array array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + array_type b = { { 0, 1, 2, 3, 4 } }; + array_type c = { { 0, 1, 2, 3, 7 } }; + + VERIFY( a <= b ); + VERIFY( a <= c ); +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/comparison_operators/greater_or_equal.cc =================================================================== --- testsuite/23_containers/array/comparison_operators/greater_or_equal.cc (revision 0) +++ testsuite/23_containers/array/comparison_operators/greater_or_equal.cc (revision 0) @@ -0,0 +1,41 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + const size_t len = 5; + typedef std::array array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + array_type b = { { 0, 1, 2, 3, 4 } }; + array_type c = { { 0, 1, 2, 3, 7 } }; + + VERIFY( a >= b ); + VERIFY( c >= a ); +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/comparison_operators/less.cc =================================================================== --- testsuite/23_containers/array/comparison_operators/less.cc (revision 0) +++ testsuite/23_containers/array/comparison_operators/less.cc (revision 0) @@ -0,0 +1,42 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2004, 2005, 2006, 2007, 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 + +void +test01() +{ + const size_t len = 5; + typedef std::array array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + array_type b = { { 0, 1, 2, 3, 4 } }; + array_type c = { { 0, 1, 2, 3, 7 } }; + + VERIFY( !(a < b) ); + VERIFY( a < c ); +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/comparison_operators/equal.cc =================================================================== --- testsuite/23_containers/array/comparison_operators/equal.cc (revision 0) +++ testsuite/23_containers/array/comparison_operators/equal.cc (revision 0) @@ -0,0 +1,41 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + const size_t len = 5; + typedef std::array array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + array_type b = { { 0, 1, 2, 3, 4 } }; + array_type c = { { 0, 1, 2, 3 } }; + + VERIFY( a == b ); + VERIFY( !(a == c) ); +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/comparison_operators/not_equal.cc =================================================================== --- testsuite/23_containers/array/comparison_operators/not_equal.cc (revision 0) +++ testsuite/23_containers/array/comparison_operators/not_equal.cc (revision 0) @@ -0,0 +1,41 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + const size_t len = 5; + typedef std::array array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + array_type b = { { 0, 1, 2, 3, 4 } }; + array_type c = { { 0, 1, 2, 3 } }; + + VERIFY( !(a != b) ); + VERIFY( a != c ); +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/comparison_operators/greater.cc =================================================================== --- testsuite/23_containers/array/comparison_operators/greater.cc (revision 0) +++ testsuite/23_containers/array/comparison_operators/greater.cc (revision 0) @@ -0,0 +1,41 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + const size_t len = 5; + typedef std::array array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + array_type b = { { 0, 1, 2, 3, 4 } }; + array_type c = { { 0, 1, 2, 3, 7 } }; + + VERIFY( !(a > b) ); + VERIFY( c > a ); +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/tuple_interface/tuple_element.cc =================================================================== --- testsuite/23_containers/array/tuple_interface/tuple_element.cc (revision 0) +++ testsuite/23_containers/array/tuple_interface/tuple_element.cc (revision 0) @@ -0,0 +1,49 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 namespace std; + + { + const size_t len = 3; + typedef array array_type; + VERIFY( (is_same::type, int>::value == true) ); + VERIFY( (is_same::type, int>::value == true) ); + VERIFY( (is_same::type, int>::value == true) ); + } + + { + const size_t len = 0; + typedef array array_type; + VERIFY( (is_same::type, int>::value == true) ); + } +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/tuple_interface/tuple_size.cc =================================================================== --- testsuite/23_containers/array/tuple_interface/tuple_size.cc (revision 0) +++ testsuite/23_containers/array/tuple_interface/tuple_size.cc (revision 0) @@ -0,0 +1,46 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std; + + { + const size_t len = 5; + typedef array array_type; + VERIFY( tuple_size::value == 5 ); + } + + { + const size_t len = 0; + typedef array array_type; + VERIFY( tuple_size::value == 0 ); + } +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/element_access/at_out_of_range.cc =================================================================== --- testsuite/23_containers/array/element_access/at_out_of_range.cc (revision 0) +++ testsuite/23_containers/array/element_access/at_out_of_range.cc (revision 0) @@ -0,0 +1,54 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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; + + const size_t len = 5; + typedef std::array array_type; + array_type a = { { 0, 1, 2, 3, 4 } }; + + try + { + a.at(len); + VERIFY( false ); + } + catch(std::out_of_range& obj) + { + // Expected. + VERIFY( true ); + } + catch(...) + { + // Failed. + VERIFY( false ); + } +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/element_access/at_neg.cc =================================================================== --- testsuite/23_containers/array/element_access/at_neg.cc (revision 0) +++ testsuite/23_containers/array/element_access/at_neg.cc (working copy) @@ -26,6 +26,6 @@ // exception end up in a terminate handler which eventually exits, // or abort. (Depending on -fno-exceptions.) constexpr std::array a{{1, 2, 3}}; - auto i = a.at(4); + auto i __attribute__((unused)) = a.at(4); return 0; } Index: testsuite/23_containers/array/element_access/constexpr_element_access.cc =================================================================== --- testsuite/23_containers/array/element_access/constexpr_element_access.cc (revision 0) +++ testsuite/23_containers/array/element_access/constexpr_element_access.cc (working copy) @@ -24,8 +24,8 @@ { // array typedef std::array array_type; - constexpr array_type a = { 0, 55, 66, 99, 4115, 2 }; - constexpr auto v1 = a[1]; - constexpr auto v2 = a.at(2); + constexpr array_type a = { { 0, 55, 66, 99, 4115, 2 } }; + constexpr auto v1 __attribute__((unused)) = a[1]; + constexpr auto v2 __attribute__((unused)) = a.at(2); return 0; } Index: testsuite/23_containers/array/element_access/back.cc =================================================================== --- testsuite/23_containers/array/element_access/back.cc (revision 0) +++ testsuite/23_containers/array/element_access/back.cc (revision 0) @@ -0,0 +1,48 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 5; + typedef std::array array_type; + + { + array_type a = { { 0, 1, 2, 3, 4 } }; + int& ri = a.back(); + VERIFY( ri == 4 ); + } + + { + const array_type ca = { { 4, 3, 2, 1, 0 } }; + const int& cri = ca.back(); + VERIFY( cri == 0 ); + } +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/element_access/front.cc =================================================================== --- testsuite/23_containers/array/element_access/front.cc (revision 0) +++ testsuite/23_containers/array/element_access/front.cc (revision 0) @@ -0,0 +1,48 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 5; + typedef std::array array_type; + + { + array_type a = { { 0, 1, 2, 3, 4 } }; + int& ri = a.front(); + VERIFY( ri == 0 ); + } + + { + const array_type ca = { { 4, 3, 2, 1, 0 } }; + const int& cri = ca.front(); + VERIFY( cri == 4 ); + } +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/element_access/data.cc =================================================================== --- testsuite/23_containers/array/element_access/data.cc (revision 0) +++ testsuite/23_containers/array/element_access/data.cc (revision 0) @@ -0,0 +1,48 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 5; + typedef std::array array_type; + + { + array_type a = { { 0, 1, 2, 3, 4 } }; + int* pi = a.data(); + VERIFY( *pi == 0 ); + } + + { + const array_type ca = { { 4, 3, 2, 1, 0 } }; + const int* pci = ca.data(); + VERIFY( *pci == 4 ); + } +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/iterators/end_is_one_past.cc =================================================================== --- testsuite/23_containers/array/iterators/end_is_one_past.cc (revision 0) +++ testsuite/23_containers/array/iterators/end_is_one_past.cc (revision 0) @@ -0,0 +1,42 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 5; + typedef std::array array_type; + array_type a = { { 0, 1, 2, 3, 4 } }; + + array_type::iterator b = a.begin(); + array_type::iterator e = a.end(); + + VERIFY( e != (b + a.size() - 1) ); +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/capacity/empty.cc =================================================================== --- testsuite/23_containers/array/capacity/empty.cc (revision 0) +++ testsuite/23_containers/array/capacity/empty.cc (revision 0) @@ -0,0 +1,51 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + { + bool test __attribute__((unused)) = true; + + const size_t len = 5; + typedef std::array array_type; + array_type a = { { 0, 1, 2, 3, 4 } }; + + VERIFY( a.empty() == false ); + } + + { + bool test __attribute__((unused)) = true; + + const size_t len = 0; + typedef std::array array_type; + array_type a; + + VERIFY( a.empty() == true ); + } +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/capacity/max_size.cc =================================================================== --- testsuite/23_containers/array/capacity/max_size.cc (revision 0) +++ testsuite/23_containers/array/capacity/max_size.cc (revision 0) @@ -0,0 +1,51 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + { + bool test __attribute__((unused)) = true; + + const size_t len = 5; + typedef std::array array_type; + array_type a = { { 0, 1, 2, 3, 4 } }; + + VERIFY( a.max_size() == len ); + } + + { + bool test __attribute__((unused)) = true; + + const size_t len = 0; + typedef std::array array_type; + array_type a; + + VERIFY( a.max_size() == len ); + } +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/23_containers/array/capacity/size.cc =================================================================== --- testsuite/23_containers/array/capacity/size.cc (revision 0) +++ testsuite/23_containers/array/capacity/size.cc (revision 0) @@ -0,0 +1,51 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 + +void +test01() +{ + { + bool test __attribute__((unused)) = true; + + const size_t len = 5; + typedef std::array array_type; + array_type a = { { 0, 1, 2, 3, 4 } }; + + VERIFY( a.size() == len ); + } + + { + bool test __attribute__((unused)) = true; + + const size_t len = 0; + typedef std::array array_type; + array_type a; + + VERIFY( a.size() == len ); + } +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/20_util/duration/cons/1_neg.cc =================================================================== --- testsuite/20_util/duration/cons/1_neg.cc (revision 178910) +++ testsuite/20_util/duration/cons/1_neg.cc (working copy) @@ -2,7 +2,7 @@ // { dg-options "-std=gnu++0x" } // { dg-require-cstdint "" } -// Copyright (C) 2008, 2009 Free Software Foundation +// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation // // 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 @@ -38,3 +38,7 @@ duration d2_copy(d2); // { dg-error "no matching|no type" } } +// { dg-prune-output "include" } + +// Discard a bogus warning showing up with -Wall. +// { dg-prune-output "suggest parentheses around" } Index: testsuite/20_util/tuple/creation_functions/constexpr.cc =================================================================== --- testsuite/20_util/tuple/creation_functions/constexpr.cc (revision 178910) +++ testsuite/20_util/tuple/creation_functions/constexpr.cc (working copy) @@ -34,12 +34,14 @@ { { typedef std::tuple tuple_type; - constexpr tuple_type p1 = std::make_tuple(22, 22.222); + constexpr tuple_type p1 __attribute__((unused)) + = std::make_tuple(22, 22.222); } { typedef std::tuple tuple_type; - constexpr tuple_type p1 = std::make_tuple(22, 22.222, 77799); + constexpr tuple_type p1 __attribute__((unused)) + = std::make_tuple(22, 22.222, 77799); } } @@ -50,13 +52,15 @@ { typedef std::tuple tuple_type; constexpr tuple_type t1 { 55, 77.77 }; - constexpr auto var = std::get<1>(t1); + constexpr auto var __attribute__((unused)) + = std::get<1>(t1); } { typedef std::tuple tuple_type; constexpr tuple_type t1 { 55, 77.77, 99 }; - constexpr auto var = std::get<2>(t1); + constexpr auto var __attribute__((unused)) + = std::get<2>(t1); } } @@ -69,7 +73,7 @@ constexpr tuple_type1 t1 { 55, 77.77 }; constexpr tuple_type2 t2 { 55, 99, 77.77 }; - constexpr auto cat1 = std::tuple_cat(t1, t2); + constexpr auto cat1 __attribute__((unused)) = std::tuple_cat(t1, t2); } int Index: testsuite/20_util/pair/make_pair/constexpr.cc =================================================================== --- testsuite/20_util/pair/make_pair/constexpr.cc (revision 178910) +++ testsuite/20_util/pair/make_pair/constexpr.cc (working copy) @@ -18,7 +18,6 @@ // with this library; see the file COPYING3. If not see // . - // NOTE: This makes use of the fact that we know how moveable // is implemented on pair, and also vector. If the implementation // changes this test may begin to fail. @@ -31,7 +30,7 @@ { bool test __attribute__((unused)) = true; typedef std::pair pair_type; - constexpr pair_type p1 = std::make_pair(22, 22.222); + constexpr pair_type p1 __attribute__((unused)) = std::make_pair(22, 22.222); } int Index: testsuite/20_util/time_point/nonmember/constexpr.cc =================================================================== --- testsuite/20_util/time_point/nonmember/constexpr.cc (revision 178910) +++ testsuite/20_util/time_point/nonmember/constexpr.cc (working copy) @@ -35,11 +35,11 @@ constexpr duration d0(12); constexpr duration d1(3); - constexpr auto r1 = t1 + d0; - constexpr auto r2 = d1 + t2; + constexpr auto r1 __attribute__((unused)) = t1 + d0; + constexpr auto r2 __attribute__((unused)) = d1 + t2; - constexpr auto r3 = t1 - d0; - constexpr auto r4 = t2 - t3; + constexpr auto r3 __attribute__((unused)) = t1 - d0; + constexpr auto r4 __attribute__((unused)) = t2 - t3; return 0; } Index: testsuite/20_util/forward/1_neg.cc =================================================================== --- testsuite/20_util/forward/1_neg.cc (revision 178910) +++ testsuite/20_util/forward/1_neg.cc (working copy) @@ -41,3 +41,5 @@ std::shared_ptr sp1 = factory(2, 1.414); // { dg-error "required from here" } } +// Discard a bogus warning showing up with -Wall. +// { dg-prune-output "control reaches end of" }