[libcxx-commits] [PATCH] D143033: [libc++] Disable some tests in `math_nodiscard_extensions`.

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 1 01:42:19 PST 2023


philnik added a comment.

In D143033#4095618 <https://reviews.llvm.org/D143033#4095618>, @var-const wrote:

> In D143033#4095259 <https://reviews.llvm.org/D143033#4095259>, @philnik wrote:
>
>> It's not exactly documentation, but you can look at `clang/include/clang/Basic/Builtins.def` to see what attributes are applied to builtins and what builtins there are.
>
> Thanks. If I'm reading this correctly, though, this applies to `__builtin_foo` functions only, right?

No, this also applies to the non-`__builtin_` versions. The math functions are declared at about line 1200 (currently).

> Taking a step back, I also don't think we should be testing compiler behavior or relying on what is essentially an implementation detail of Clang and presumably GCC.

The `[[nodiscard]]` declarations are specifically there to match the diagnostics produced by the compiler, so I think we should check that the compiler actually produces the same diagnostic for all overloads. (https://godbolt.org/z/87hMPjeq7)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143033



More information about the libcxx-commits mailing list