beman-project / Optional26

Beman.Optional26: `std::optional` extensions targeting C++26
Apache License 2.0
4 stars 4 forks source link

gtest won't allow to check for code which should not compile #13

Open neatudarius opened 2 weeks ago

neatudarius commented 2 weeks ago

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) {}
camio commented 2 weeks ago

@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?