This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56762] New: too aggressive optimization or missing warnings
- From: "npl at chello dot at" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 28 Mar 2013 10:37:09 +0000
- Subject: [Bug c++/56762] New: too aggressive optimization or missing warnings
- Auto-submitted: auto-generated
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