Skip to content

Conversation

@steve-downey
Copy link
Member

Make unit testing constexpr compatible in C++20.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120868 was in the way, at least partially.

Fixes #123

C++20 compilers more restricted in their constexpr capabilities. Use fewer of
the gtest macros, which are not consteval capable in C++20 with GCC.
Run cmake and clang formatting passes.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 15959666185

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 15955469950: 0.0%
Covered Lines: 306
Relevant Lines: 306

💛 - Coveralls

include_guard(GLOBAL)

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD 20)
Copy link
Member

@JeffGarland JeffGarland Jul 1, 2025

Choose a reason for hiding this comment

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

I mean this works around the compile bug for tests, but my bug report would still be a problem?

sorry had to refresh my memory -- this directly tests my issue, thanks

std::abort();
} else {
gtest_expect_eq(std::forward<U>(val1), std::forward<V>(val2));
}
Copy link
Member

Choose a reason for hiding this comment

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

This is a nice improvement

@JeffGarland
Copy link
Member

LGTM - ship it.

@steve-downey steve-downey merged commit e0db02c into bemanproject:main Jul 1, 2025
11 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.

optional_range_support.t.cpp static asserts fail to compile (gcc-14 and gcc-15, c++20) -- ok with c++23 and c++26a

4 participants