[all-commits] [llvm/llvm-project] 633927: [libc++] Add [[nodiscard]] extensions in <math.h>

philnik777 via All-commits all-commits at lists.llvm.org
Thu Jan 12 09:35:02 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 633927db844e47c87dd93198e2c2763dd10f668f
      https://github.com/llvm/llvm-project/commit/633927db844e47c87dd93198e2c2763dd10f668f
  Author: Nikolas Klauser <nikolasklauser at berlin.de>
  Date:   2023-01-12 (Thu, 12 Jan 2023)

  Changed paths:
    M libcxx/docs/UsingLibcxx.rst
    M libcxx/include/math.h
    M libcxx/include/stdlib.h
    A libcxx/test/libcxx/diagnostics/math_nodiscard_extensions.verify.cpp

  Log Message:
  -----------
  [libc++] Add [[nodiscard]] extensions in <math.h>

There are quite a few functions marked `[[gnu::const]]` inside the compiler. This patch adds `[[nodiscard]]` to libc++-provided overloads of these functions to match the diagnostics produced.

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D140855




More information about the All-commits mailing list