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: unassig...@gcc.gnu.org
        ReportedBy: thom.hel...@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

Reply via email to