[PATCH] D23926: [libcxx] Don't use C99 math ops in -std=c++03 mode

Asiri Rathnayake via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 27 00:48:35 PDT 2016


rmaprath added a comment.

In https://reviews.llvm.org/D23926#527080, @EricWF wrote:

> We already provide many C++11 extensions in C++03 mode, why should this be an exception?


This is kind of what I wanted to find out. Do we document what those extensions are?

We have quite a strict C library which is picky about what it exposes under different standards. For example, it won't expose `C99` math ops if it is being used under `__cplusplus < 201103L`, which leads to compiler errors (when integrated with `libc++` and used with `-std=c++03`) for a simple program like:

  #include <math.h>
  int x;

We could make our C library a bit more lenient to fix this, but I couldn't find it documented anywhere what stand `libcxx` takes on C++03 support. I also sent an email to `cfe-dev` about this but didn't get much attention, so I decided to start with a patch instead :)

I'm happy to document these C++03 extensions on libcxx.llvm.org if I can find out what those extensions are. Any pointers?

Cheers,

/ Asiri


https://reviews.llvm.org/D23926





More information about the cfe-commits mailing list