fix: resolve clang >= 17 compilation error in extract<const T>() - #623
Open
jschueller wants to merge 1 commit into
Open
fix: resolve clang >= 17 compilation error in extract<const T>()#623jschueller wants to merge 1 commit into
jschueller wants to merge 1 commit into
Conversation
jschueller
marked this pull request as ready for review
May 21, 2026 07:41
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
m_value is now non-const, but extract<const T>() still casts to algo_inner<const T>. Construction stores algo_inner<uncvref_t<T>>, so a const-qualified extraction still returns nullptr instead of matching the underlying UDA as the API docs promise. Please strip cv in the cast target too and add an extract<const T>() regression test.
inner classes now store m_value as remove_const_t<T> so non-const get_ptr() returning &m_value as void* no longer drops const and clang >=17 no longer errors. Also fix extract<const T>() which previously cast to inner<const T> (or rejected in typeid_name_extract) while construction stores inner<uncvref_t<T>>, causing const-qualified extraction to return nullptr contrary to API docs. Now cast/compare via uncvref_t<T> (and reinterpret to T*) uniformly for algorithm, problem, island, bfe, topology, r/s_policy; typeid_name_extract now allows cv-qualified T and compares typeid(uncvref_t<T>). Add extract<const T>() regression test in algorithm and fix island expectations. Closes esa#584.
Contributor
Author
|
done, thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The non-const get_ptr() in UDx inner classes tries to return &m_value as void*, but when T is const-qualified this drops const without an explicit cast, which clang >= 17 rejects. Use std::remove_const_t for the m_value member so &m_value is always a non-const pointer. This avoids const_cast entirely and applies uniformly across all UDx types (island, problem, algorithm, topology, bfe, s_policy, r_policy).
Closes #584.