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++/56762] New: too aggressive optimization or missing warnings


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56762

             Bug #: 56762
           Summary: too aggressive optimization or missing warnings
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: npl@chello.at


Created attachment 29743
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29743
code describing the issue

Alternatively this could be just me misunderstanding C++.
But the issue is that I have an object created on the stack and I would expect
it to survive until it goes out of scope.
Now I understand that I probably used it the wrong way by giving it a temporary
when it needed a reference to something more solid, but I would expect an error
message in this case.

Please look at the provided code, which compiles without error/warning. the
exchange function wont have any calls to lock/unlock.

tested with gcc 4.7.2 + 4.8.0


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