aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-12-03 10:02:02 +0100
committerJakub Jelinek <jakub@redhat.com>2020-12-03 10:04:54 +0100
commit381d1d0120e4dfab3a714f44354e868a80dbaa25 (patch)
tree0ae5f82816ddde0d8418777bf52ba22e404d82e4 /gcc
parent70310982492071f98eacdac0747521769b0f0328 (diff)
downloadgcc-381d1d0120e4dfab3a714f44354e868a80dbaa25.zip
gcc-381d1d0120e4dfab3a714f44354e868a80dbaa25.tar.gz
gcc-381d1d0120e4dfab3a714f44354e868a80dbaa25.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.dg/warn/pr98104.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/pr98104.C b/gcc/testsuite/g++.dg/warn/pr98104.C
new file mode 100644
index 0000000..6ca617b
--- /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]*'" }
+}