Skip to content

update macros for codecvt and support C++26 support on clang19#1113

Merged
phlptp merged 10 commits intoCLIUtils:mainfrom
jmarrec:cpp26_codecvt
Jan 11, 2025
Merged

update macros for codecvt and support C++26 support on clang19#1113
phlptp merged 10 commits intoCLIUtils:mainfrom
jmarrec:cpp26_codecvt

Conversation

@jmarrec
Copy link
Copy Markdown
Contributor

@jmarrec jmarrec commented Jan 6, 2025

The commit you care about is 9a2884a @phlptp

where I fix the build error on LLVM 19 with C++26 after rooting the actual template issue (see #1098 (comment))

It comes down to C++26 adding a tuple interface to std::complex https://en.cppreference.com/w/cpp/numeric/complex/tuple_size

static_assert(!CLI::detail::is_tuple_like<std::string>::value, "std::string should not be like a tuple");
static_assert(!CLI::detail::is_tuple_like<double>::value, "double should not be like a tuple");
static_assert(CLI::detail::is_tuple_like<std::tuple<double, int, double>>::value, "tuple should look like a tuple");
static_assert(!CLI::detail::is_tuple_like<std::complex<double>>::value, "std::complex should not be like a tuple");
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static assert test

Comment on lines +298 to +300
// Even though in C++26 std::complex gains a std::tuple interface, for our purposes we treat is as NOT a tuple
template <typename S> class is_tuple_like {
template <typename SS>
template <typename SS, enable_if_t<!is_complex<SS>::value, detail::enabler> = detail::dummy>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the fix is here

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (e4ee3af) to head (9a2884a).
Report is 64 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##              main     #1113     +/-   ##
===========================================
  Coverage   100.00%   100.00%             
===========================================
  Files           17        17             
  Lines         4546      5034    +488     
  Branches         0      1029   +1029     
===========================================
+ Hits          4546      5034    +488     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@phlptp
Copy link
Copy Markdown
Collaborator

phlptp commented Jan 10, 2025

@henryiii I am going to merge this and close the other one tomorrow unless you have other thoughts.

@phlptp phlptp merged commit 10ac3e5 into CLIUtils:main Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants