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 libstdc++/47185] New: UB in TR1 and C++0x placeholders and non conforming implementation


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


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