[libcxx] [llvm] [libc++][math][c++17] P0226R1 - Mathematical Special Functions: infra + `std::assoc_laguerre` (PR #205649)

Hristo Hristov via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 04:36:51 PDT 2026


================
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: std-at-least-c++17
+
+// The functions carry availability markup, so referencing them fails to compile against a
+// back-deployment target whose libc++ predates them.
+// XFAIL: availability-mathematical_special_functions-missing
+
+// Check that functions are marked [[nodiscard]]
+
+#include <cmath>
+
+void test() {
+  // clang-format off
+  // assoc_laguerre
+  std::assoc_laguerre(0, 0, 0.0f);  // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
----------------
H-G-Hristov wrote:

```suggestion
  // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
  std::assoc_laguerre(0, 0, 0.0f);
```

I recommend switching to the above style. Then you can drop the clang-format off comment and let it format everything and not bother doing it manually.

https://github.com/llvm/llvm-project/pull/205649


More information about the llvm-commits mailing list