Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed noexcept benchmark build for gcc. #2235

Merged
merged 1 commit into from
May 21, 2021

Conversation

proydakov
Copy link

Description

Hi, Catch team.
I see compilation problem with benchmark & catch2 in noexcept gcc mode:

usr/bin/c++ -DCATCH_CONFIG_MAIN -I_deps/catch2-src/single_include -I../memory/include -I../constant/include -std=c++20 -fno-rtti -fno-exceptions -Wall -Werror -Wextra -pedantic -pedantic-errors -Wunused -Wconversion -Wsign-conversion -D_GLIBCXX_USE_CXX11_ABI=1 -fdiagnostics-color=always -O3 -DNDEBUG -std=c++2a -MD -MT memory/test/CMakeFiles/test_stream_fixed_pool_allocator.dir/test_stream_fixed_pool_allocator.cpp.o -MF memory/test/CMakeFiles/test_stream_fixed_pool_allocator.dir/test_stream_fixed_pool_allocator.cpp.o.d -o memory/test/CMakeFiles/test_stream_fixed_pool_allocator.dir/test_stream_fixed_pool_allocator.cpp.o -c ../memory/test/test_stream_fixed_pool_allocator.cpp
In file included from ../memory/test/test_stream_fixed_pool_allocator.cpp:3:
_deps/catch2-src/single_include/catch2/catch.hpp: In instantiation of ‘Catch::Benchmark::TimingOf<Clock, Fun, Catch::Benchmark::Detail::run_for_at_least_argument_t<Clock, Fun> > Catch::Benchmark::Detail::run_for_at_least(Catch::Benchmark::ClockDuration, int, Fun&&) [with Clock = std::chrono::_V2::steady_clock; Fun = const Catch::Benchmark::Detail::BenchmarkFunction&; Catch::Benchmark::TimingOf<Clock, Fun, Catch::Benchmark::Detail::run_for_at_least_argument_t<Clock, Fun> > = Catch::Benchmark::Timing<std::chrono::duration<long int, std::ratio<1, 1000000000> >, Catch::Benchmark::Detail::CompleteType::type>; Catch::Benchmark::Detail::run_for_at_least_argument_t<Clock, Fun> = Catch::Benchmark::Chronometer; Catch::Benchmark::ClockDuration = std::chrono::duration<long int, std::ratio<1, 1000000000> >]’:
_deps/catch2-src/single_include/catch2/catch.hpp:7299:62: required from ‘Catch::Benchmark::ExecutionPlan<std::chrono::duration<double, typename Clock::period> > Catch::Benchmark::Benchmark::prepare(const Catch::IConfig&, Catch::Benchmark::Environment<std::chrono::duration<double, typename Clock::period> >) const [with Clock = std::chrono::_V2::steady_clock; typename Clock::period = std::ratio<1, 1000000000>]’
_deps/catch2-src/single_include/catch2/catch.hpp:7313:46: required from ‘void Catch::Benchmark::Benchmark::run() [with Clock = std::chrono::_V2::steady_clock]’
_deps/catch2-src/single_include/catch2/catch.hpp:7347:20: required from ‘Catch::Benchmark::Benchmark& Catch::Benchmark::Benchmark::operator=(Fun) [with Fun = ____C_A_T_C_H____T_E_S_T____8()::<lambda(int)>; typename std::enable_if<(! Catch::Benchmark::Detail::is_related<Fun, Catch::Benchmark::Benchmark>::value), int>::type = 0]’
../memory/test/test_stream_fixed_pool_allocator.cpp:83:5: required from here
_deps/catch2-src/single_include/catch2/catch.hpp:6882:17: error: exception handling disabled, use ‘-fexceptions’ to enable
6882 | throw optimized_away_error{};
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
[30/46] Building CXX object platform/example/CMakeFiles/platform_core_2_core_latancy.dir/core_2_core_latancy.cpp.o^C

Could you review & accept my changes, pls ?

@codecov
Copy link

codecov bot commented May 20, 2021

Codecov Report

Merging #2235 (70e0529) into v2.x (5c88067) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             v2.x    #2235   +/-   ##
=======================================
  Coverage   88.78%   88.78%           
=======================================
  Files         139      139           
  Lines        5705     5705           
=======================================
  Hits         5065     5065           
  Misses        640      640           

@horenmar
Copy link
Member

Thanks, lgtm.

@horenmar horenmar merged commit b15b862 into catchorg:v2.x May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants