Skip to content

Commit 11e9777

Browse files
elbenomjcaisse-intel
authored andcommitted
🚸 Work around clang bug with consteval UDLs
Problem: - clang has a persistent regression where it ICEs with the error "trying to emit a call to an immediate function". This seems to be provoked by `consteval` UDLs. Solution: - When using clang, mark UDLs as `constexpr` rather than `consteval`.
1 parent 95fed9f commit 11e9777

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ include(cmake/string_catalog.cmake)
2525
add_versioned_package("gh:boostorg/mp11#boost-1.83.0")
2626
fmt_recipe(11.1.3)
2727
add_versioned_package("gh:intel/cpp-baremetal-concurrency#0ddce52")
28-
add_versioned_package("gh:intel/cpp-std-extensions#7e1cbc7")
28+
add_versioned_package("gh:intel/cpp-std-extensions#effadd4")
2929
add_versioned_package("gh:intel/cpp-baremetal-senders-and-receivers#22c8006")
3030

3131
set(GEN_STR_CATALOG

include/interrupt/fwd.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ using priority_t = std::size_t;
1111

1212
inline namespace literals {
1313
// NOLINTNEXTLINE(google-runtime-int)
14-
CONSTEVAL auto operator""_irq(unsigned long long int v) -> irq_num_t {
14+
CONSTEVAL_UDL auto operator""_irq(unsigned long long int v) -> irq_num_t {
1515
return static_cast<irq_num_t>(v);
1616
}
1717
} // namespace literals

include/msg/field.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,21 +279,21 @@ enum struct lsb_t : std::uint32_t {};
279279

280280
inline namespace literals {
281281
// NOLINTNEXTLINE(google-runtime-int)
282-
CONSTEVAL auto operator""_bi(unsigned long long int v) -> byte_index_t {
282+
CONSTEVAL_UDL auto operator""_bi(unsigned long long int v) -> byte_index_t {
283283
return static_cast<byte_index_t>(v);
284284
}
285-
CONSTEVAL auto operator""_dwi(unsigned long long int v) -> dword_index_t {
285+
CONSTEVAL_UDL auto operator""_dwi(unsigned long long int v) -> dword_index_t {
286286
return static_cast<dword_index_t>(v);
287287
}
288-
CONSTEVAL auto operator""_dw(unsigned long long int v) -> dword_index_t {
288+
CONSTEVAL_UDL auto operator""_dw(unsigned long long int v) -> dword_index_t {
289289
return static_cast<dword_index_t>(v);
290290
}
291291
// NOLINTNEXTLINE(google-runtime-int)
292-
CONSTEVAL auto operator""_lsb(unsigned long long int v) -> lsb_t {
292+
CONSTEVAL_UDL auto operator""_lsb(unsigned long long int v) -> lsb_t {
293293
return static_cast<lsb_t>(v);
294294
}
295295
// NOLINTNEXTLINE(google-runtime-int)
296-
CONSTEVAL auto operator""_msb(unsigned long long int v) -> msb_t {
296+
CONSTEVAL_UDL auto operator""_msb(unsigned long long int v) -> msb_t {
297297
return static_cast<msb_t>(v);
298298
}
299299
} // namespace literals

0 commit comments

Comments
 (0)