<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/149610>149610</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Can't `#include <llvm/ADT/FloatingPointMode.h>` with `-std=c++23` with clang++ 21.1.0-rc1
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
chriselrod
</td>
</tr>
</table>
<pre>
```c++
#include <llvm/ADT/FloatingPointMode.h>
int main(){
return 0;
}
```
I get
```
❯ clang++ llvminclude.cpp
~/Documents/progwork/cxx/test
❯ clang++ -std=c++23 llvminclude.cpp
In file included from llvminclude.cpp:1:
In file included from /usr/include/llvm/ADT/FloatingPointMode.h:19:
In file included from /usr/include/llvm/ADT/StringSwitch.h:16:
/usr/include/llvm/ADT/StringRef.h:864:22: error: 'enable_if' attribute expression never
produces a constant expression
864 | __attribute((enable_if(__builtin_strlen(Str) == N - 1,
| ^
/usr/include/llvm/ADT/FloatingPointMode.h:193:14: note: in instantiation of function
template specialization 'llvm::StringLiteral::StringLiteral<1UL>' requested here
193 | .Cases("", "ieee", DenormalMode::IEEE)
| ^
/usr/include/llvm/ADT/StringRef.h:864:49: note: read of variable 'Str' whose value is not
known
864 | __attribute((enable_if(__builtin_strlen(Str) == N - 1,
| ^
/usr/include/llvm/ADT/StringRef.h:860:42: note: declared here
860 | constexpr StringLiteral(const char (&Str)[N])
| ^
/usr/include/llvm/ADT/StringRef.h:864:22: error: 'enable_if' attribute expression never
produces a constant expression
864 | __attribute((enable_if(__builtin_strlen(Str) == N - 1,
| ^
/usr/include/llvm/ADT/FloatingPointMode.h:193:18: note: in instantiation of function
template specialization 'llvm::StringLiteral::StringLiteral<5UL>' requested here
193 | .Cases("", "ieee", DenormalMode::IEEE)
| ^
/usr/include/llvm/ADT/StringRef.h:864:49: note: read of variable 'Str' whose value is not
known
864 | __attribute((enable_if(__builtin_strlen(Str) == N - 1,
| ^
/usr/include/llvm/ADT/StringRef.h:860:42: note: declared here
860 | constexpr= StringLiteral(const char (&Str)[N])
| ^
/usr/include/llvm/ADT/StringRef.h:864:22: error: 'enable_if' attribute expression never
produces a constant expression
864 | __attribute((enable_if(__builtin_strlen(Str) == N - 1,
| ^
/usr/include/llvm/ADT/FloatingPointMode.h:194:13: note: in instantiation of function
template specialization 'llvm::StringLiteral::StringLiteral<14UL>' requested here
194 | .Case("preserve-sign", DenormalMode::PreserveSign)
| ^
/usr/include/llvm/ADT/StringRef.h:864:49: note: read of variable 'Str' whose value is not
known
864 | __attribute((enable_if(__builtin_strlen(Str) == N - 1,
| ^
/usr/include/llvm/ADT/StringRef.h:860:42: note: declared here
860 | constexpr StringLiteral(const char (&Str)[N])
| ^
/usr/include/llvm/ADT/StringRef.h:864:22: error: 'enable_if' attribute expression never
produces a constant expression
864 | __attribute((enable_if(__builtin_strlen(Str) == N - 1,
| ^
/usr/include/llvm/ADT/FloatingPointMode.h:196:13: note: in instantiation of function
template specialization 'llvm::StringLiteral::StringLiteral<8UL>' requested here
196 | .Case("dynamic", DenormalMode::Dynamic)
| ^
/usr/include/llvm/ADT/StringRef.h:864:49: note: read of variable 'Str' whose value is not
known
864 | __attribute((enable_if(__builtin_strlen(Str) == N - 1,
| ^
/usr/include/llvm/ADT/StringRef.h:860:42: note: declared here
860 | constexpr StringLiteral(const char (&Str)[N])
| ^
4 errors generated.
```
This works with clang++ 20.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzsWE1v4zYT_jXjCxFDGsr6OOigWBYQYN_F4s32bNDS2GIjky5J2dke-tsLSk7WSeNs2g0QFDVByDY5nI9nZh7IFNbKjSLKYXYNs3Iietdqk9etkZY6o5vJSjffcoiDcdaA134GBSCXqu76hhjwedftt4BVUX4FrKpOCyfV5ouWyv1PNzRtgS_8maCQyrGtkAowBcwg8aoYM-R6o1gAfFCdlP75YBOC4oZtyD1bgwVCVkJRsboTajM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