public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Marek Polacek <mpolacek@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-8022] c++: Add test for Core issue 1376 [PR52202]
Date: Wed,  7 Apr 2021 02:19:38 +0000 (GMT)	[thread overview]
Message-ID: <20210407021938.364E83894C35@sourceware.org> (raw)

https://gcc.gnu.org/g:a7698c0e1ecad65b1ab651acc82b34e12c7efd35

commit r11-8022-ga7698c0e1ecad65b1ab651acc82b34e12c7efd35
Author: Marek Polacek <polacek@redhat.com>
Date:   Tue Apr 6 22:17:33 2021 -0400

    c++: Add test for Core issue 1376 [PR52202]
    
    As Jens says in the PR, we handle this correctly.
    
    gcc/testsuite/ChangeLog:
    
            PR c++/52202
            * g++.dg/cpp0x/rv-life.C: New test.

Diff:
---
 gcc/testsuite/g++.dg/cpp0x/rv-life.C | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gcc/testsuite/g++.dg/cpp0x/rv-life.C b/gcc/testsuite/g++.dg/cpp0x/rv-life.C
new file mode 100644
index 00000000000..0fd1119d3ff
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/rv-life.C
@@ -0,0 +1,12 @@
+// Core 1376
+// PR c++/52202
+// { dg-do run { target c++11 } }
+
+extern "C" void abort();
+bool x;
+struct T { ~T() { if (!x) abort (); } };
+int main()
+{
+  T&& r = static_cast<T&&>(T());
+  x = true;
+}


                 reply	other threads:[~2021-04-07  2:19 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=20210407021938.364E83894C35@sourceware.org \
    --to=mpolacek@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).