Fixes compilation with CLang 3.2 and libc++.

This libc++ is the standard c++ library of the LLVM project.
Backport of 16b4210fa9bf6ab811bb4b4620667fc1aeaec17f.
Fixes bug #21303.