Commit 353d6a9
authored
[libc++] Conditionally declare
An older PR #102036 suggested
that LLVM libc declares `lgamma_r` as noexcept and is incompatible with
this redeclaration. However, I recently discovered that glibc also
declares the math functions to be noexcept under C++ mode.
This line usually don't cause issues because both the glibc and this
file are included as "system headers". According to [this
godbolt](https://godbolt.org/z/o7Wd9PP58), both GCC and clang ignore the
different exception specification between multiple declarations if they
are in system headers.
However, this seems not the case for NVCC/EDG, so a fix for this
redeclaration is still desirable. This patch proposes that we should
declare the function as noexcept under known libc integrations to keep
the declared function consistent.lgamma_r as noexcept (#156547)1 parent 132bacd commit 353d6a9
1 file changed
+14
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
102 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
103 | 113 | | |
104 | 114 | | |
105 | 115 | | |
106 | | - | |
| 116 | + | |
107 | 117 | | |
108 | 118 | | |
109 | 119 | | |
| |||
0 commit comments