Fix build error with LLVM 21 due to operator function redefinition #3349
+8
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This issue was discovered after SPEC CPU integrated #3316. The SPEC copy of
vtr_strong_id_range.his old, so I tried my best to apply the same fixes here, but please test yourself.From the SPEC release manager:
Our builds were failing with LLVM 21 due to redefinition of iterator operators. Here's one example:
If you look closely, you'll see that the locations of the original definition as well as the redefinition are the same in all cases. I thought this was kind of cuckoo-bananas but Claude explained to me that it's because each templated instantiation of StrongIdIterator got its own set of operator functions definition that weren't tied to the class type. Or in its own(?) words:
To my mild surprise, Claude was right and the suggested changes, which are the changes in this MR, built and ran all workloads with both LLVM 21.1.6 (impossible before) and GCC 15.2.0 (possible before).