This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Committed, PR54897 (was: [C++ PATCH] -Wsizeof-pointer-memaccess warning (take 2))
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Thu, 11 Oct 2012 13:39:57 +0200
- Subject: Committed, PR54897 (was: [C++ PATCH] -Wsizeof-pointer-memaccess warning (take 2))
> From: Hans-Peter Nilsson <hp@axis.com>
> Date: Thu, 11 Oct 2012 02:13:32 +0200
> There's now an "excess error":
>
> x/libstdc++-v3/testsuite/23_containers/bitset/45713.cc:24:55:
> error: size of array 'test' is not an integral constant-expression
> int test[sizeof(std::bitset<0xffffffff>) != 1 ? 1 : -1];
>
> Or is the error message in error and just "missing" before?
> Please have a look.
As per discussion in PR54897, I committed the following, after
correcting the target syntax in the cutnpasted patch there.
(The target parser is picky about matching *-*-*, which I guess is
appropriate since it has to handle effective-targets as well.)
PR testsuite/54897
* testsuite/23_containers/bitset/45713.cc: Skip for avr*-*-*
cris*-*-* h8300*-*-* mcore*-*-* moxie*-*-*.
Index: libstdc++-v3/testsuite/23_containers/bitset/45713.cc
===================================================================
--- libstdc++-v3/testsuite/23_containers/bitset/45713.cc (revision 192353)
+++ libstdc++-v3/testsuite/23_containers/bitset/45713.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010 Free Software Foundation, Inc.
+// Copyright (C) 2010, 2012 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
@@ -15,7 +15,10 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-do compile }
+// The testcase requires bitsizetype to be wider than sizetype,
+// otherwise types/vars with 0x20000000 bytes or larger can't be used.
+// See http://gcc.gnu.org/PR54897
+// { dg-do compile { target { ! { avr*-*-* cris*-*-* h8300*-*-* mcore*-*-* moxie*-*-* } } } }
#include <bitset>
brgds, H-P