C++11 builds with clang 3.2 and stdlibc++-4.4


Following the information here: http://clang.llvm.org/cxx_status.html I've been attempting to use clang 3.2 in C++11 mode with stdlibc++-4.4. It seems that the patch linked on that page is incomplete, as I soon encountered problems with pair, shared_ptr and tuple.

I've attempted to extend the patch to fix those problems (see attached diff). Most were trivial changes due to C++0x to C++11 default ctor/op rule differences, but to fix the tuple problem I've essentially back-ported the header contents from stdlibc++-4.5.4.

I'd be interested in feedback and/or to contribute this new patch.

Many thanks,

libstdc++4.4-clang11.patch (21.2 KB)

You should submit the patch to stdlibc++ project :wink:

Weird, I wasn’t aware of this :slight_smile: CC Jeffrey as he seems to be the author of the original patch.

P.S. You down under, mate?

It's probably worth removing that patch. libstdc++-4.4 is probably
much older than you should expect to use with C++11 nowadays.

Are there any specific problems / dangers using the (patched) libstdc++-4.4 with recent clang in c++11 mode?

My target environment is RHEL6.5 (gcc-4.4.7) which is the latest RHEL release. It is very desirable to use c++11 without having to upgrade the system stdlibc++. I imagine many others would be in this situation also.


ps The patch I linked has a reversed diff for tuple. If anyone is interested, I can post / submit a fixed version.