From 4ed6e5244652aa10eb56ab0cfa6768654f16f854 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 18 Apr 2016 16:44:25 +0100 Subject: [PATCH] Make use of extensions more explicit in libstdc++ tests * testsuite/18_support/bad_exception/23591_thread-1.c: Add -Wno-pedantic to dg-options. * testsuite/20_util/align/2.cc: Use type as operand of alignof. * testsuite/20_util/is_floating_point/value.cc: Add -Wno-pedantic to dg-options. * testsuite/20_util/specialized_algorithms/uninitialized_fill/32158.cc: Remove extra semi-colon. * testsuite/23_containers/array/tuple_interface/tuple_element.cc: Always supply second argument to static_assert. * testsuite/25_algorithms/lower_bound/no_operator_ne.cc: Remove extra semi-colon. * testsuite/26_numerics/complex/c99.cc: Add -Wno-pedantic to dg-options. * testsuite/26_numerics/complex/literals/values.cc: Likewise. * testsuite/29_atomics/atomic/60695.cc: Likewise. * testsuite/29_atomics/atomic/62259.cc: use __alignof__ instead of alignof when operand is an object not a type. * testsuite/decimal/ctor.cc: Add -Wno-pedantic to dg-options. * testsuite/decimal/make-decimal.cc: Likewise. * testsuite/experimental/type_traits/value.cc: Always supply second argument to static_assert. * testsuite/util/testsuite_common_types.h: Use __extension__ for __int128 types. From-SVN: r235154 --- libstdc++-v3/ChangeLog | 24 ++++++++++++++ .../18_support/bad_exception/23591_thread-1.c | 2 +- libstdc++-v3/testsuite/20_util/align/2.cc | 2 +- .../20_util/is_floating_point/value.cc | 2 +- .../uninitialized_fill/32158.cc | 2 +- .../array/tuple_interface/tuple_element.cc | 2 +- .../lower_bound/no_operator_ne.cc | 4 +-- .../testsuite/26_numerics/complex/c99.cc | 2 +- .../26_numerics/complex/literals/values.cc | 2 +- .../testsuite/29_atomics/atomic/60695.cc | 2 +- .../testsuite/29_atomics/atomic/62259.cc | 4 +-- libstdc++-v3/testsuite/decimal/ctor.cc | 1 + .../testsuite/decimal/make-decimal.cc | 1 + .../experimental/type_traits/value.cc | 32 +++++++++---------- .../testsuite/util/testsuite_common_types.h | 8 ++--- 15 files changed, 58 insertions(+), 32 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 076f18bfc0a..385363bda88 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,29 @@ 2016-04-18 Jonathan Wakely + * testsuite/18_support/bad_exception/23591_thread-1.c: Add + -Wno-pedantic to dg-options. + * testsuite/20_util/align/2.cc: Use type as operand of alignof. + * testsuite/20_util/is_floating_point/value.cc: Add -Wno-pedantic + to dg-options. + * testsuite/20_util/specialized_algorithms/uninitialized_fill/32158.cc: + Remove extra semi-colon. + * testsuite/23_containers/array/tuple_interface/tuple_element.cc: + Always supply second argument to static_assert. + * testsuite/25_algorithms/lower_bound/no_operator_ne.cc: Remove extra + semi-colon. + * testsuite/26_numerics/complex/c99.cc: Add -Wno-pedantic to + dg-options. + * testsuite/26_numerics/complex/literals/values.cc: Likewise. + * testsuite/29_atomics/atomic/60695.cc: Likewise. + * testsuite/29_atomics/atomic/62259.cc: use __alignof__ instead of + alignof when operand is an object not a type. + * testsuite/decimal/ctor.cc: Add -Wno-pedantic to dg-options. + * testsuite/decimal/make-decimal.cc: Likewise. + * testsuite/experimental/type_traits/value.cc: Always supply second + argument to static_assert. + * testsuite/util/testsuite_common_types.h: Use __extension__ for + __int128 types. + * testsuite/experimental/type_erased_allocator/1.cc: Don't include internal header. * testsuite/experimental/type_erased_allocator/1_neg.cc: Likewise. diff --git a/libstdc++-v3/testsuite/18_support/bad_exception/23591_thread-1.c b/libstdc++-v3/testsuite/18_support/bad_exception/23591_thread-1.c index a0fe0d7c806..fd1a76cbd31 100644 --- a/libstdc++-v3/testsuite/18_support/bad_exception/23591_thread-1.c +++ b/libstdc++-v3/testsuite/18_support/bad_exception/23591_thread-1.c @@ -1,5 +1,5 @@ // { dg-require-sharedlib "" } -// { dg-options "-g -O2 -pthread -ldl -x c -fvtable-verify=none" { target *-*-linux* *-*-gnu* *-*-solaris2.1[2-9]* } } +// { dg-options "-g -O2 -pthread -ldl -x c -fvtable-verify=none -Wno-pedantic" { target *-*-linux* *-*-gnu* *-*-solaris2.1[2-9]* } } // Copyright (C) 2005-2016 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/20_util/align/2.cc b/libstdc++-v3/testsuite/20_util/align/2.cc index 243debb25e1..e2d1907a460 100644 --- a/libstdc++-v3/testsuite/20_util/align/2.cc +++ b/libstdc++-v3/testsuite/20_util/align/2.cc @@ -32,7 +32,7 @@ test01() int i = 0; void* ptr = &i; auto space = sizeof(i); - auto p2 = std::align(alignof(i), space, ptr, space); + auto p2 = std::align(alignof(int), space, ptr, space); VERIFY( ptr == &i ); VERIFY( p2 == &i ); VERIFY(space == sizeof(i)); diff --git a/libstdc++-v3/testsuite/20_util/is_floating_point/value.cc b/libstdc++-v3/testsuite/20_util/is_floating_point/value.cc index d4763832fe2..8ed73fcce2a 100644 --- a/libstdc++-v3/testsuite/20_util/is_floating_point/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_floating_point/value.cc @@ -1,4 +1,4 @@ -// { dg-options "-std=gnu++11" } +// { dg-options "-std=gnu++11 -Wno-pedantic" } // { dg-do compile } // // Copyright (C) 2011-2016 Free Software Foundation, Inc. diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/32158.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/32158.cc index 821d0122009..fc0542680a6 100644 --- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/32158.cc +++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/32158.cc @@ -31,4 +31,4 @@ Alpha(MyPair* start, MyPair* end) { MyPair my_pair(1, 2); std::uninitialized_fill(start, end, my_pair); -}; +} diff --git a/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element.cc b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element.cc index 6abe04966a9..96e0bfbe72b 100644 --- a/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element.cc +++ b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element.cc @@ -47,7 +47,7 @@ test01() static_assert(is_same::type, volatile int>::value, ""); static_assert( (is_same::type, - volatile int>::value == true) ); + volatile int>::value == true), "" ); static_assert(is_same::type, const volatile int>::value, ""); diff --git a/libstdc++-v3/testsuite/25_algorithms/lower_bound/no_operator_ne.cc b/libstdc++-v3/testsuite/25_algorithms/lower_bound/no_operator_ne.cc index d787ff0dd78..219e0934b10 100644 --- a/libstdc++-v3/testsuite/25_algorithms/lower_bound/no_operator_ne.cc +++ b/libstdc++-v3/testsuite/25_algorithms/lower_bound/no_operator_ne.cc @@ -22,8 +22,8 @@ // http://gcc.gnu.org/ml/libstdc++/2000-06/msg00316.html struct foo { }; -bool operator== (const foo&, const foo&) { return true; }; -bool operator< (const foo&, const foo&) { return true; }; +bool operator== (const foo&, const foo&) { return true; } +bool operator< (const foo&, const foo&) { return true; } void bar(foo* a, foo* b, foo& x) { diff --git a/libstdc++-v3/testsuite/26_numerics/complex/c99.cc b/libstdc++-v3/testsuite/26_numerics/complex/c99.cc index 4dfaad65952..c550520657e 100644 --- a/libstdc++-v3/testsuite/26_numerics/complex/c99.cc +++ b/libstdc++-v3/testsuite/26_numerics/complex/c99.cc @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-options "-std=gnu++11" } +// { dg-options "-std=gnu++11 -Wno-pedantic" } // Copyright (C) 2012-2016 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/26_numerics/complex/literals/values.cc b/libstdc++-v3/testsuite/26_numerics/complex/literals/values.cc index b50aad9acb8..1353112297c 100644 --- a/libstdc++-v3/testsuite/26_numerics/complex/literals/values.cc +++ b/libstdc++-v3/testsuite/26_numerics/complex/literals/values.cc @@ -1,4 +1,4 @@ -// { dg-options "-std=gnu++14" } +// { dg-options "-std=gnu++14 -Wno-pedantic" } // { dg-do run } // Copyright (C) 2013-2016 Free Software Foundation, Inc. diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/60695.cc b/libstdc++-v3/testsuite/29_atomics/atomic/60695.cc index e9b8b2094fb..ddd1b2ca051 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic/60695.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic/60695.cc @@ -1,5 +1,5 @@ // { dg-require-atomic-builtins "" } -// { dg-options "-std=gnu++11" } +// { dg-options "-std=gnu++11 -Wno-pedantic" } // { dg-do compile } // Copyright (C) 2014-2016 Free Software Foundation, Inc. diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/62259.cc b/libstdc++-v3/testsuite/29_atomics/atomic/62259.cc index 5429ca987a2..458194a3bd1 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic/62259.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic/62259.cc @@ -44,7 +44,7 @@ struct power_of_two_obj { std::atomic obj1; -static_assert( alignof(obj1) >= alignof(int64_t), +static_assert( __alignof__(obj1) >= alignof(int64_t), "std::atomic not suitably aligned" ); struct container_struct { @@ -54,5 +54,5 @@ struct container_struct { container_struct obj2; -static_assert( alignof(obj2.ao) >= alignof(int64_t), +static_assert( __alignof__(obj2.ao) >= alignof(int64_t), "std::atomic not suitably aligned" ); diff --git a/libstdc++-v3/testsuite/decimal/ctor.cc b/libstdc++-v3/testsuite/decimal/ctor.cc index f322e7f1ff9..b289ed04e06 100644 --- a/libstdc++-v3/testsuite/decimal/ctor.cc +++ b/libstdc++-v3/testsuite/decimal/ctor.cc @@ -16,6 +16,7 @@ // . // { dg-require-effective-target dfp } +// { dg-options "-Wno-pedantic" } // ISO/IEC TR 24733 3.2.2.1 Construct/copy/destroy (decimal32). // ISO/IEC TR 24733 3.2.3.1 Construct/copy/destroy (decimal64). diff --git a/libstdc++-v3/testsuite/decimal/make-decimal.cc b/libstdc++-v3/testsuite/decimal/make-decimal.cc index 42a608a3a47..b5aafa25e66 100644 --- a/libstdc++-v3/testsuite/decimal/make-decimal.cc +++ b/libstdc++-v3/testsuite/decimal/make-decimal.cc @@ -16,6 +16,7 @@ // . // { dg-require-effective-target dfp } +// { dg-options "-Wno-pedantic" } // ISO/IEC TR 24733 3.2.5 Initialization from coefficient and exponent. diff --git a/libstdc++-v3/testsuite/experimental/type_traits/value.cc b/libstdc++-v3/testsuite/experimental/type_traits/value.cc index 5bbdab442c6..16b63cbf47b 100644 --- a/libstdc++-v3/testsuite/experimental/type_traits/value.cc +++ b/libstdc++-v3/testsuite/experimental/type_traits/value.cc @@ -323,23 +323,23 @@ static_assert(is_convertible_v static_assert(!is_convertible_v && !is_convertible::value, ""); -static_assert(negation_v); -static_assert(!negation_v); -static_assert(conjunction_v<>); -static_assert(!disjunction_v<>); -static_assert(conjunction_v); -static_assert(!conjunction_v); -static_assert(disjunction_v); -static_assert(!disjunction_v); -static_assert(conjunction_v); -static_assert(!conjunction_v); -static_assert(disjunction_v); -static_assert(!disjunction_v); +static_assert(negation_v, ""); +static_assert(!negation_v, ""); +static_assert(conjunction_v<>, ""); +static_assert(!disjunction_v<>, ""); +static_assert(conjunction_v, ""); +static_assert(!conjunction_v, ""); +static_assert(disjunction_v, ""); +static_assert(!disjunction_v, ""); +static_assert(conjunction_v, ""); +static_assert(!conjunction_v, ""); +static_assert(disjunction_v, ""); +static_assert(!disjunction_v, ""); static_assert(conjunction_v); + true_type>, ""); static_assert(!conjunction_v); + false_type>, ""); static_assert(disjunction_v); + true_type>, ""); static_assert(!disjunction_v); + false_type>, ""); diff --git a/libstdc++-v3/testsuite/util/testsuite_common_types.h b/libstdc++-v3/testsuite/util/testsuite_common_types.h index bf1035e8e32..d6a766d3c19 100644 --- a/libstdc++-v3/testsuite/util/testsuite_common_types.h +++ b/libstdc++-v3/testsuite/util/testsuite_common_types.h @@ -304,8 +304,8 @@ namespace __gnu_test typedef char16_t a14; typedef char32_t a15; # if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128) - typedef __int128 a16; - typedef unsigned __int128 a17; + __extension__ typedef __int128 a16; + __extension__ typedef unsigned __int128 a17; typedef node<_GLIBCXX_TYPELIST_CHAIN17(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, @@ -316,8 +316,8 @@ namespace __gnu_test # endif #else # if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128) - typedef __int128 a14; - typedef unsigned __int128 a15; + __extension__ typedef __int128 a14; + __extension__ typedef unsigned __int128 a15; typedef node<_GLIBCXX_TYPELIST_CHAIN15(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15)> type;