gtest won't allow to check for code which should not compile. Maybe we can try another framework which allows a semantic like "THIS_SHOULD_NOT_COMPILE(... code...)" (not sure if possible).
Usage example: Check that for C++23 std::optional the next code won't compile:
std::optional<int> opt{};
for (auto && x : opt) {}
@ldionne , you mentioned at C++Now the idea of using the LLVM unit test framework in Beman. Is this something you would still recommend? Does it support this use case? Where can we learn more about it?
gtest won't allow to check for code which should not compile. Maybe we can try another framework which allows a semantic like "THIS_SHOULD_NOT_COMPILE(... code...)" (not sure if possible).
Usage example: Check that for C++23 std::optional the next code won't compile: