catchorg / catchorg/Catch2

Nested THEN/AND_THEN statements in a loop trigger assert.

Open
#579 3 comments 1 reaction 0 assignees View on GitHub
Serious bug
Dominant language
C++
Stars
21.5k
Forks
3.5k
Avg merge
3d 16h
Merged PRs (30d)
2

Description

The following code, and variations of it, breaks for me using Catch v1.3.3 on Visual Studio 2015:

```
for (int i = 0; i < 10; ++i) {
WHEN("Foo") {
THEN("Bar") {
REQUIRE(true);
}
AND_THEN("Baz") {
REQUIRE(true);
}
}
}
```

This is the failing assert in line 5450:
`assert(m_parent);`

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.