Skip to content

Commit

Permalink
fix: Clang 19 -Wc++20-extensions warning in template test macros (cat…
Browse files Browse the repository at this point in the history
…chorg#2910)

- Added INTERNAL_CATCH_TEMPLATE_TEST_CASE_HANDLE_EMPTY macro for Clang 19+
- Modified template test case macro expansion path for Clang 19+
- Keeps original behavior for other compilers and older Clang versions
  • Loading branch information
abhishekbelgaonkar23 committed Nov 16, 2024
1 parent 156d28e commit 2487da6
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/catch2/catch_template_test_macros.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// Copyright Catch2 Authors
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.txt or copy at
Expand All @@ -8,15 +7,10 @@
#ifndef CATCH_TEMPLATE_TEST_MACROS_HPP_INCLUDED
#define CATCH_TEMPLATE_TEST_MACROS_HPP_INCLUDED

// We need this suppression to leak, because it took until GCC 10
// for the front end to handle local suppression via _Pragma properly
// inside templates (so `TEMPLATE_TEST_CASE` and co).
// **THIS IS DIFFERENT FOR STANDARD TESTS, WHERE GCC 9 IS SUFFICIENT**
#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && __GNUC__ < 10
#pragma GCC diagnostic ignored "-Wparentheses"
#endif


#include <catch2/catch_test_macros.hpp>
#include <catch2/internal/catch_template_test_registry.hpp>
#include <catch2/internal/catch_preprocessor.hpp>
Expand Down

0 comments on commit 2487da6

Please sign in to comment.