[libcxx-commits] [PATCH] D136538: [libc++] Add test for checking progress on P0533R9

Evgeny Shulgin via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 24 10:42:36 PDT 2022


Izaron added a comment.

> Could you also add a test for GCC and the global namespace versions of the functions?

Does "test for GCC" mean testing how GCC would compile libc++?

I think we could make it by copy-pasting the file with changing `// REQUIRES: clang` to `// REQUIRES: gcc`.

But we need to think how we could declare functions constexpr giving that GCC doesn't support `__has_constexpr_builtin`? Since GCC supposedly supports a ton of builtins now, we could check `__has_constexpr_builtin` for Clang and the compiler's version for GCC. Would that work?

  #ifdef __clang__
  #  if __has_constexpr_builtin(__builtin_fmax)
       constexpr
  #  endif
  #elifdef __GNU__
  #  if __GNU_VERSION__ >= 1234
       constexpr
  #  endif
  #endif
  double fmax(double a, double b) { return __builtin_fmax(a, b); }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136538



More information about the libcxx-commits mailing list