[Bug libstdc++/47185] New: UB in TR1 and C++0x placeholders and non conforming implementation
thom.heller at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Jan 5 19:16:00 GMT 2011
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-defined 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
More information about the Gcc-bugs
mailing list