Patchwork Committed, PR54897 (was: [C++ PATCH] -Wsizeof-pointer-memaccess warning (take 2))

login
register
mail settings
Submitter Hans-Peter Nilsson
Date Oct. 11, 2012, 11:39 a.m.
Message ID <201210111139.q9BBdvoY027696@ignucius.se.axis.com>
Download mbox | patch
Permalink /patch/190871/
State New
Headers show

Comments

Hans-Peter Nilsson - Oct. 11, 2012, 11:39 a.m.
> 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*-*-*.


brgds, H-P

Patch

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>