Skip to content

Conversation

@trueqbit
Copy link
Collaborator

@trueqbit trueqbit commented Nov 24, 2025

New Visual C++ 18 2026 as well as Clang 21 are out. In an attempt to compile sqlite_orm with these new toolchains I corrected and improved things along the way.

Fixes:

  • Corrected deprecated spacing in user-defined literal operators, e.g. operator"" _cte() -> operator""_cte().

Generic improvements:

  • Updated to clang-format 20.
  • Used the single-argument version of static_assert, which was not possible with C++14 before.
  • Removed a few unused type aliases in unit tests.
  • Addressed a few warnings about unused variables.

Clang related:

  • Temporarily disable spurious Clang warnings instead of suppressing them in code, which makes code cleaner and less likely to forget to suppress them on spot.
  • Clang understands C++26 features even in C++17 mode, but it doesn't mean it understands other language features, so we need to be specific using them.
  • Needed to disable compiling the R*Tree module with Clang because Clang chokes on using constexpr variables in lambdas. This is an unfixed issue reported several times to the Clang maintainers.

Clang MSVC:

  • Made sqlite_orm compile with Clang MSVC. Specifically it still cannot use functions exported from DLLs as compile-time parameters, so we provide workarounds for it.

* Temporarily disable spurious Clang warnings instead of suppressing them in code.
* Clang understands C++26 even in C++17 mode, but it doesn't mean it understands other language features, so we need to be specific using them.
* Removed a few unused type aliases in UTs.
* Addressed a few warnings about unused variables.
* Needed to disable the rtree module example because Clang chokes on using constexpr variables in lambdas.
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.

Compilation errors with clang on windows: error: constexpr variable 'value' must be initialized by a constant expression

2 participants