This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/52202] New: [C++11][DR 1376] Should not extend lifetime of temporary wrapped in static_cast to reference type


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;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]