public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-8022] c++: Add test for Core issue 1376 [PR52202]
@ 2021-04-07 2:19 Marek Polacek
0 siblings, 0 replies; only message in thread
From: Marek Polacek @ 2021-04-07 2:19 UTC (permalink / raw)
To: gcc-cvs
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;
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-04-07 2:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07 2:19 [gcc r11-8022] c++: Add test for Core issue 1376 [PR52202] Marek Polacek
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).