This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52202] New: [C++11][DR 1376] Should not extend lifetime of temporary wrapped in static_cast to reference type
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 10 Feb 2012 21:28:24 +0000
- Subject: [Bug c++/52202] New: [C++11][DR 1376] Should not extend lifetime of temporary wrapped in static_cast to reference type
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52202
Bug #: 52202
Summary: [C++11][DR 1376] Should not extend lifetime of
temporary wrapped in static_cast to reference type
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: jason@gcc.gnu.org
// Core 1376
// { dg-options -std=c++0x }
extern "C" void abort();
bool x;
struct T { ~T() { if (x) abort (); } };
int main()
{
T&& r = static_cast<T&&>(T());
x = true;
}