catchorg / catchorg/Catch2

Catch cannot be used if `_` is a macro / defined (2.13.5-2.13.8)

Open
#2,363 9 comments 1 reaction 0 assignees View on GitHub
Won't Fix
Dominant language
C++
Stars
21.5k
Forks
3.5k
Avg merge
3d 16h
Merged PRs (30d)
2

Description

A single underscore was used as a name here:

https://github.com/catchorg/Catch2/blob/958944d27a2d2fb82aa008377bf4f8752f6b848e/include/internal/catch_run_context.cpp#L455

This breaks tests that are simulating the common practice of `#define`ing a `_` macro that handles translation. Broken in https://github.com/catchorg/Catch2/commit/8f277a54c0b9c1d1024dedcb2dec1d206971e745, breaks pybind11 in https://github.com/pybind/pybind11/pull/3679.

The test in pybind11 is adding a `-D_=1` to ensure that pybind11 doesn't break when `_` is defined to something, this might be a good idea for a test for Catch's code, too.

~~I can't tell where that comment came in, it was after (working) 2.13.3 and is in (broken) 2.13.8. By date, maybe v2.13.6~~. I wish I could use git bisect on tags! :) Edit: first broken version is 2.13.5.

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.