public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-5698] testsuite: Add testcase for already fixed PR [PR98104]
Date: Thu,  3 Dec 2020 09:05:00 +0000 (GMT)	[thread overview]
Message-ID: <20201203090500.A78793854818@sourceware.org> (raw)

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]*'" }
+}


                 reply	other threads:[~2020-12-03  9:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201203090500.A78793854818@sourceware.org \
    --to=jakub@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).