testsuite: Fix up g++.dg/warn/Wuninitialized-32.C test for ilp32 [PR104373]

Message ID 20220210232959.GM2646553@tucnak
State New
Headers
Series testsuite: Fix up g++.dg/warn/Wuninitialized-32.C test for ilp32 [PR104373] |

Commit Message

Jakub Jelinek Feb. 10, 2022, 11:29 p.m. UTC
  On Thu, Feb 10, 2022 at 10:57:02AM +0100, Richard Biener via Gcc-patches wrote:
> > >>>   * g++.dg/warn/Wuninitialized-32.C: New testcase.

The testcase FAILs whenever size_t is not unsigned long:
FAIL: g++.dg/warn/Wuninitialized-32.C  -std=c++98 (test for excess errors)
Excess errors:
.../gcc/testsuite/g++.dg/warn/Wuninitialized-32.C:4:7: error: 'operator new' takes type 'size_t' ('unsigned int') as first parameter [-fpermissive]

Fixed by using __SIZE_TYPE__ instead of unsigned long.

Regtested on x86_64-linux -m32/-m64, committed to trunk as obvious.

2022-02-11  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/104373
	* g++.dg/warn/Wuninitialized-32.C (operator new[]): Use __SIZE_TYPE__
	as type of the first argument instead of unsigned long.



	Jakub
  

Patch

--- gcc/testsuite/g++.dg/warn/Wuninitialized-32.C.jj	2022-02-11 00:19:22.376064016 +0100
+++ gcc/testsuite/g++.dg/warn/Wuninitialized-32.C	2022-02-11 00:25:45.194857715 +0100
@@ -1,7 +1,7 @@ 
 // { dg-do compile }
 // { dg-additional-options "-Wall" }
 
-void* operator new[](unsigned long, void* __p);
+void* operator new[](__SIZE_TYPE__, void* __p);
 
 struct allocator
 {