public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-5698] testsuite: Add testcase for already fixed PR [PR98104]
@ 2020-12-03  9:05 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2020-12-03  9:05 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:381d1d0120e4dfab3a714f44354e868a80dbaa25

commit r11-5698-g381d1d0120e4dfab3a714f44354e868a80dbaa25
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Dec 3 10:02:02 2020 +0100

    testsuite: Add testcase for already fixed PR [PR98104]
    
    This testcase got broken with r11-3826 and got fixed with r11-5628.
    
    2020-12-03  Jakub Jelinek  <jakub@redhat.com>
    
            PR c++/98104
            * g++.dg/warn/pr98104.C: New test.

Diff:
---
 gcc/testsuite/g++.dg/warn/pr98104.C | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gcc/testsuite/g++.dg/warn/pr98104.C b/gcc/testsuite/g++.dg/warn/pr98104.C
new file mode 100644
index 00000000000..6ca617befe2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pr98104.C
@@ -0,0 +1,20 @@
+// PR c++/98104
+
+#include <new>
+
+struct B
+{
+  B ();
+  int *a;
+  char b;
+};
+
+struct D : public B {};
+void bar (B *);
+
+void
+foo ()
+{
+  D d;
+  bar (::new (static_cast<B*>(&d)) B);	// { dg-bogus "placement new constructing an object of type 'B' and size '\[0-9]*' in a region of type 'B' and size '\[0-9]*'" }
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-03  9:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03  9:05 [gcc r11-5698] testsuite: Add testcase for already fixed PR [PR98104] Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).