Skip to content

Swap std::is_trivial with non deprecated traits#541

Merged
biojppm merged 2 commits intobiojppm:masterfrom
P3RK4N:cxx26-remove-deprecated
Sep 16, 2025
Merged

Swap std::is_trivial with non deprecated traits#541
biojppm merged 2 commits intobiojppm:masterfrom
P3RK4N:cxx26-remove-deprecated

Conversation

@P3RK4N
Copy link
Copy Markdown
Contributor

@P3RK4N P3RK4N commented Sep 6, 2025

Summary

This PR resolves the deprecation warning triggered by the use of std::is_trivial<LineCol> in RapidYAML headers when building on C++26 standard.


Warning Details

During build, the following warning was emitted:

/bin/_deps/rapidyaml-src/src/c4/yml/common.hpp:291:20: warning: 'is_trivial[c4::yml::LineCol]' is deprecated:
Consider using is_trivially_copyable<T>::value && is_trivially_default_constructible<T>::value instead [-Wdeprecated-declarations]

On line:

static_assert(std::is_trivial<LineCol>::value, "LineCol not trivial");


Notes

  • No functional changes to RapidYAML.
  • Build output is now clean on all supported platforms/compilers.
  • Future-proof against deprecated traits warnings in C++26, but still complies with C++11.

@P3RK4N P3RK4N force-pushed the cxx26-remove-deprecated branch from 469b2f1 to f8e8c99 Compare September 6, 2025 12:17
Comment thread src/c4/yml/common.hpp Outdated
@P3RK4N P3RK4N force-pushed the cxx26-remove-deprecated branch from f8e8c99 to c5a586a Compare September 6, 2025 20:26
@P3RK4N
Copy link
Copy Markdown
Contributor Author

P3RK4N commented Sep 13, 2025

Hey @biojppm, sorry for being unresponsive!
So, coverage tests are failing due to missing token, I guess we are fine with that.
Regarding clang_tidy test, we can either supress the warning or split the static assert into 2 separate ones.

Let me know how do you want me to proceed.

@biojppm
Copy link
Copy Markdown
Owner

biojppm commented Sep 13, 2025

Please split.

Split the triviality check due to clang_tidy warning
@P3RK4N P3RK4N requested a review from biojppm September 14, 2025 18:25
@biojppm
Copy link
Copy Markdown
Owner

biojppm commented Sep 15, 2025

Thanks!

@biojppm biojppm merged commit c90f8b3 into biojppm:master Sep 16, 2025
281 of 291 checks passed
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