testsuite: Fix up new51.C test on various targets [PR108533]
authorJakub Jelinek <jakub@redhat.com>
Tue, 24 Jan 2023 23:12:46 +0000 (00:12 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 24 Jan 2023 23:12:46 +0000 (00:12 +0100)
The test fails on targets where size_t is not unsigned long
due to extra diagnostics.

As the testcase is tested in C++98 too, I'm not using decltype (sizeof 0)
but __SIZE_TYPE__.

2023-01-25  Jakub Jelinek  <jakub@redhat.com>

PR c++/107329
PR testsuite/108533
* g++.dg/init/new51.C (size_t): New typedef.
(RexxClass::operator new, RexxClass::operator delete): Use size_t
instead of unsigned long.

gcc/testsuite/g++.dg/init/new51.C

index d8b3364..89c0f87 100644 (file)
@@ -1,9 +1,10 @@
 // PR c++/107329
 
+typedef __SIZE_TYPE__ size_t;
 struct RexxClass {
-  void *operator new(unsigned long, unsigned long, const char *, RexxClass *,
+  void *operator new(size_t, size_t, const char *, RexxClass *,
                      RexxClass *);
-  void operator delete(void *, unsigned long, const char *, RexxClass *,
+  void operator delete(void *, size_t, const char *, RexxClass *,
                        RexxClass *);
   RexxClass();
 };