[libcxx-commits] [PATCH] D107239: [libcxx] Remove _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 2 08:46:10 PDT 2021


Mordante added inline comments.


================
Comment at: libcxx/include/__config:1295
 
-#if !__has_builtin(__builtin_is_constant_evaluated) && _GNUC_VER < 900
-#define _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED
----------------
tschuett wrote:
> Could you keep this check as a test to catch unsupported compilers, i.e. move it to the test folder?
I think it isn't useful to have this in the test folder. This will only catch issues if the user with an unsupported compiler runs the test suite.
If we want to validate the support status it's probably better to do something along the lines of
```
#if defined(_GNU_VER) && _GNU_VER < 1100
#errror "Only GCC 11 and 12 are supported."
#elif ... // all other supported platforms.

```
in `__config`.

Then the unsupported compiler is caught when a user uses it. (Obviously this also catches using it for unit tests.)
WDYT?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107239/new/

https://reviews.llvm.org/D107239



More information about the libcxx-commits mailing list