]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
Pull in r158245 from upstream clang:
authordim <dim@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 2 Dec 2012 00:31:23 +0000 (00:31 +0000)
committerdim <dim@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 2 Dec 2012 00:31:23 +0000 (00:31 +0000)
commit3574ee3f14aac99763943f0fe8de64ee1289fd35
treea9e4543c10ab5ca1536228e3e6ec9a0d218619e7
parent387b8e69874102258ed7e8c444786279bbc276b8
Pull in r158245 from upstream clang:

  [C++11 Compat] Fix breaking change in C++11 pair copyctor.

  While this code is valid C++98, it is not valid C++11. The problem
  can be reduced to:

  class MDNode;

  class DIType {
    operator MDNode*() const {return 0;}
  };

  class WeakVH {
    WeakVH(MDNode*) {}
  };

  int main() {
    DIType di;
    std::pair<void*, WeakVH> p(std::make_pair((void*)0, di)));
  }

  This was not detected by any of the bots we have because they either
  compile C++98 with libstdc++ (which allows it), or C++11 with libc++
  (which incorrectly allows it). I ran into the problem when compiling
  with VS 2012 RC.

  Thanks to Richard for explaining the issue.

This fixes building clang 3.1 on stable/9 with libc++ in C++11 mode.

This is a direct commit to stable/9, since there is no separate commit
in head which has just this particular change, and I do not want to do a
full import at this time.

Reported by: Marco Bröder <marco.broeder@gmx.eu>

git-svn-id: svn://svn.freebsd.org/base/stable/9@243781 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp