This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/47185] New: UB in TR1 and C++0x placeholders and non conforming implementation
- From: "thom.heller at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 5 Jan 2011 19:05:23 +0000
- Subject: [Bug libstdc++/47185] New: UB in TR1 and C++0x placeholders and non conforming implementation
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47185
Summary: UB in TR1 and C++0x placeholders and non conforming
implementation
Product: gcc
Version: 4.5.1
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: thom.heller@gmail.com
According to C++ TR1 3.6.4 [tr.func.bind.place] and C++0x (n3092) 20.8.10.1.3
[func.bind.place] placeholders are declared as:
namespace placeholders {
// M is the implementation-deïned number of placeholders
extern unspecified _1;
extern unspecified _2;
.
.
.
extern unspecified _M;
}
However, in libstdc++ they are defined as:
namespace placeholders
{
namespace
{
_Placeholder<1> _1;
_Placeholder<2> _2;
.
.
.
_Placeholder<29> _29;
}
}
The implementation is the same for tr1 and c++0x.
This implementation can lead to UB as discussed here:
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/c08e83496d251ba9?pli=1