Hi!

This testcase got broken with r11-3826 and got fixed with r11-5628.

Tested on x86_64-linux -m32/-m64 with current trunk as well as 4 days old
compiler, committed to trunk as obvious.

2020-12-03  Jakub Jelinek  <ja...@redhat.com>

        PR c++/98104
        * g++.dg/warn/pr98104.C: New test.

--- gcc/testsuite/g++.dg/warn/pr98104.C
+++ 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]*'" }
+}

        Jakub

Reply via email to