From bfe3f13ecc92228ae31fa606c57bbd60d048ee56 Mon Sep 17 00:00:00 2001 From: Niko Fink Date: Mon, 18 Mar 2024 17:23:03 +0100 Subject: [PATCH] fix shadowed variable `e` in SNOWHOUSE_ASSERT_THROWS --- include/snowhouse/exceptions.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/snowhouse/exceptions.h b/include/snowhouse/exceptions.h index 4da7667..2a93a7a 100644 --- a/include/snowhouse/exceptions.h +++ b/include/snowhouse/exceptions.h @@ -99,12 +99,12 @@ namespace snowhouse catch (...) \ { \ SNOWHOUSE_TEMPVAR(wrong_exception) = true; \ - if (auto eptr = std::current_exception()) { \ + if (auto SNOWHOUSE_TEMPVAR(eptr) = std::current_exception()) { \ try { \ - std::rethrow_exception(eptr); \ - } catch (const std::exception& e) { \ + std::rethrow_exception(SNOWHOUSE_TEMPVAR(eptr)); \ + } catch (const std::exception& SNOWHOUSE_TEMPVAR(e)) { \ SNOWHOUSE_TEMPVAR(more_info) = true; \ - SNOWHOUSE_TEMPVAR(info_string) = e.what(); \ + SNOWHOUSE_TEMPVAR(info_string) = SNOWHOUSE_TEMPVAR(e).what(); \ } catch (...) {} \ } \ } \