[cfe-dev] Using C++11 in clang-tools-extra Round 2

Nico Weber thakis at chromium.org
Tue Jan 8 10:38:32 PST 2013


On Mon, Jan 7, 2013 at 5:08 PM, Vane, Edwin <edwin.vane at intel.com> wrote:
>
> Nico wrote:
> Sure, you can build clang itself, but building programs that use c++11 don't Just Work as far as I can tell:
>
> thakis at yearofthelinuxdesktop:/usr/local/google/chrome/src$ cat test.cc #include <iostream>
>
> int main() {}
> thakis at yearofthelinuxdesktop:/usr/local/google/chrome/src$
> third_party/llvm-build/Release+Asserts/bin/clang++ test.cc thakis at yearofthelinuxdesktop:/usr/local/google/chrome/src$
> third_party/llvm-build/Release+Asserts/bin/clang++ test.cc  -std=c++11 In file included from test.cc:1:
> In file included from
> /usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/iostream:39:
> In file included from
> /usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/ostream:39:
> In file included from
> /usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/ios:39:
> In file included from
> /usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/exception:148:
> /usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/exception_ptr.h:143:13:
> error: unknown type name
>       'type_info'
>       const type_info*
>             ^
> 1 error generated.
>
> [Edwin] I tried this test exactly and it worked just fine for me. I'm using clang++ 3.2. I'm on Ubuntu 12.04 with gcc 4.6.3 installed.

Ah, http://clang.llvm.org/cxx_status.html says that 4.6 and 4.7 should
be fine. I'm using 4.4, but Precise ships with 4.6, so this is
possibly not an issue.

I don't know if libstdc++ is abi-compatible with itself in c++11 mode
and in c++98 mode. I thought someone said it might not be, but I'm not
sure.

> Keep in mind that building clang/llvm with c++11 support would only be a requirement for those working with the tools-extra repository

I'm worried less about devs and more about users wanting to use
binaries / packages from tools-extra.

>
>
> --
> Edwin Vane
>   Software Developer
>   Intel of Canada, Inc.
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



More information about the cfe-dev mailing list