boostorg / boostorg/test

BOOST_DATA_TEST_CASE doesn't compile when a variable `t` is present

Open
#388 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
213
Forks
149
Avg merge
18h 17m
Merged PRs (30d)
2

Description

For a minimal working example, consider the first BOOST_DATA_TEST_CASE example that appears in the ["Operations on datasets"](https://www.boost.org/doc/libs/1_82_0/libs/test/doc/html/boost_test/tests_organization/test_cases/test_case_generation/operations.html#boost_test.tests_organization.test_cases.test_case_generation.operations.joins.example_descr) page of the documentation. This example will not compile if the variable `var` is renamed to `t`. It seems that only `t` is affected, because the example compiles fine if `t` is replaced by any other letter.

I have [asked about this on StackOverflow](https://stackoverflow.com/questions/76548435/a-simple-boost-data-test-doesnt-compile-if-an-argument-is-named-t/76548600#76548600) where the user "sehe" identified what is causing the errors: there is a line `test1case t;` in the expansion of the macro which is creating a conflict.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.