diff mbox

Fix a test with bogus size_t type

Message ID 20150402083534.GT25731@redhat.com
State New
Headers show

Commit Message

Marek Polacek April 2, 2015, 8:35 a.m. UTC
We are now more strict when accepting user-defined initializer_lists; in
particular, we now require sizetype, not just any integral type.  The
following test failed with -m32, because it had a bogus type of size_t,
with -m32 it usually should be unsigned int, not unsigned long.

Test passes now with both -m32/-m64, ok for trunk?

2015-04-02  Marek Polacek  <polacek@redhat.com>

	* g++.dg/cpp0x/pr57101.C: Use proper type for size_t.


	Marek

Comments

Jakub Jelinek April 3, 2015, 2:53 p.m. UTC | #1
On Thu, Apr 02, 2015 at 10:35:35AM +0200, Marek Polacek wrote:
> We are now more strict when accepting user-defined initializer_lists; in
> particular, we now require sizetype, not just any integral type.  The
> following test failed with -m32, because it had a bogus type of size_t,
> with -m32 it usually should be unsigned int, not unsigned long.
> 
> Test passes now with both -m32/-m64, ok for trunk?

That is obvious.

> 2015-04-02  Marek Polacek  <polacek@redhat.com>
> 
> 	* g++.dg/cpp0x/pr57101.C: Use proper type for size_t.
> 
> diff --git gcc/testsuite/g++.dg/cpp0x/pr57101.C gcc/testsuite/g++.dg/cpp0x/pr57101.C
> index 94b576f..c0fc966 100644
> --- gcc/testsuite/g++.dg/cpp0x/pr57101.C
> +++ gcc/testsuite/g++.dg/cpp0x/pr57101.C
> @@ -1,7 +1,7 @@
>  // { dg-do compile { target c++11 } }
>  // { dg-options "-fcompare-debug" }
>  
> -typedef long unsigned size_t;
> +typedef __SIZE_TYPE__ size_t;
>  namespace
>  {
>    template < typename _Tp, _Tp __v > struct integral_constant

	Jakub
diff mbox

Patch

diff --git gcc/testsuite/g++.dg/cpp0x/pr57101.C gcc/testsuite/g++.dg/cpp0x/pr57101.C
index 94b576f..c0fc966 100644
--- gcc/testsuite/g++.dg/cpp0x/pr57101.C
+++ gcc/testsuite/g++.dg/cpp0x/pr57101.C
@@ -1,7 +1,7 @@ 
 // { dg-do compile { target c++11 } }
 // { dg-options "-fcompare-debug" }
 
-typedef long unsigned size_t;
+typedef __SIZE_TYPE__ size_t;
 namespace
 {
   template < typename _Tp, _Tp __v > struct integral_constant