fix(cmake): guard test_constexpr for C++17+; remove duplicate add_test#694
Merged
kris-jusiak merged 4 commits intoMay 28, 2026
Merged
Conversation
constexpr.cpp uses constexpr lambdas and static_assert without message, both of which are C++17 features. Skip the target when building with C++14. Also remove a duplicate add_test(test_constexpr ...) left at line 82 from an earlier refactor.
kris-jusiak
pushed a commit
that referenced
this pull request
May 28, 2026
- test/ft/errors/CMakeLists.txt: enable all four compile-error tests (not_callable, not_configurable, not_dispatchable, not_transitional) using OBJECT/EXCLUDE_FROM_ALL + WILL_FAIL TRUE pattern; fixes #569 - CMakeLists.txt: merge duplicate if(SML_BUILD_BENCHMARKS) blocks; add add_custom_target(style) for clang-format and add_custom_target (clang-tidy) for static analysis, both gated on find_program - example/CMakeLists.txt: normalise test names to example_ prefix for actions_guards and arduino so ctest -E/-R filtering is consistent - Makefile: replace per-file compile rules with a thin cmake/ctest wrapper; preserves public interface (make test, make example, make all, CXXSTD=, MEMCHECK=, COVERAGE=); build dir is build-$(CXXSTD)/ so multiple standards coexist; docs targets dropped (mkdocs/Python scripts remain as standalone commands per CONTRIBUTING) Includes static_assert(true,"") cherry-pick from PR #698; will be dropped on next rebase after #698 merges. Fixes #569, closes #693 (Makefile c++14 constexpr guard subsumed by cmake wrapper which relies on the PR #694 cmake guard).
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.
Problem
test/ft/constexpr.cppuses two C++17-only features:static_assertwithout messagetest/ft/CMakeLists.txtregistered the target unconditionally, so aCMake-based C++14 build would attempt to compile it and fail.
Additionally, the file had a duplicate
add_test(test_constexpr test_constexpr)left at line 82 from an earlier refactor, which caused a CMake warning about a
duplicate test name.
Fix
Wrap
add_executable(test_constexpr)andadd_test(test_constexpr)in:Remove the duplicate
add_testentry.Related
Testing
test_constexprtarget absent, all other 34 tests pass.test_constexprpresent and passes; total 35 tests pass.Note: the root
Makefilestill lacks this guard — tracked in #693.