Skip to content

Commit 5c54b7e

Browse files
committed
Try: Adding variants to enum for clang 21.1
1 parent 1ea4e08 commit 5c54b7e

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

lib/tbb_2020.3/STAN_CHANGES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ This file documents changes done for the stan-math project
1414
- L84 Wrapped the use of `-flifetime-dse` flag in conditional on non-WINARM64
1515
- L101 Wrapped the use of `-msse` in conditional on non-WINARM64
1616

17-
- Add `constexpr` to lines 589-593 of `task.h` to fix a build failure in Clang 21.1
17+
- Added variants to the `kind_type` enum to prevent creation of out-of-range values

lib/tbb_2020.3/include/tbb/task.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,10 @@ class task_group_context : internal::no_copy {
376376
public:
377377
enum kind_type {
378378
isolated,
379-
bound
379+
bound,
380+
kind_complete,
381+
kind_detached,
382+
kind_dying
380383
};
381384

382385
enum traits_type {
@@ -586,10 +589,10 @@ class task_group_context : internal::no_copy {
586589
friend class task;
587590
friend class internal::allocate_root_with_context_proxy;
588591

589-
static constexpr kind_type binding_required = bound;
590-
static constexpr kind_type binding_completed = kind_type(bound+1);
591-
static constexpr kind_type detached = kind_type(binding_completed+1);
592-
static constexpr kind_type dying = kind_type(detached+1);
592+
static const kind_type binding_required = bound;
593+
static const kind_type binding_completed = kind_type(bound+1);
594+
static const kind_type detached = kind_type(binding_completed+1);
595+
static const kind_type dying = kind_type(detached+1);
593596

594597
//! Propagates any state change detected to *this, and as an optimisation possibly also upward along the heritage line.
595598
template <typename T>

0 commit comments

Comments
 (0)