catchorg / catchorg/Catch2

`TEMPLATE_PRODUCT_TEST_CASE` trips up `-Wsign-conversion`

Open
#2,348 1 comment 1 reaction 0 assignees View on GitHub
Warnings issue
Dominant language
C++
Stars
21.5k
Forks
3.5k
Avg merge
3d 16h
Merged PRs (30d)
2

Description

**Describe the bug**
`TEMPLATE_PRODUCT_TEST_CASE`'s internals do something to trip up `-Wsign-conversion`, which causes problems for user code.

**Expected behavior**
No warning should be visible from user code.

**Reproduction steps**
```cpp
// g++-11 -Werror=sign-conversion
#include
#include

TEMPLATE_PRODUCT_TEST_CASE("hello", "", (std::vector), (int)) {}
```
[Compiler Explorer](https://godbolt.org/z/6ra1EoTen)

**Platform information:**

- OS: Ubuntu 20.04
- Compiler+version: GCC 11
- Catch version: v2.13.8 locally; trunk on Compiler Explorer

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.