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: unassig...@gcc.gnu.org
        ReportedBy: ja...@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;
}

Reply via email to