noexcept(foo) is true when foo is a constant expression.
Details
Diff Detail
Event Timeline
test/std/utilities/variant/variant.get/get_index.pass.cpp | ||
---|---|---|
39 | THAT'S RIGHT, A CLANG BUG (https://llvm.org/bugs/show_bug.cgi?id=15481) THAT C1XX GETS CORRECT. You saw it here first. |
I also saw get_type.pass.cpp failing.
I would recommend commenting the ifndef with the clang bug URL you found.
test/std/utilities/variant/variant.get/get_index.pass.cpp | ||
---|---|---|
39 | Ha A clang bug indeed! Although IDK how sane the other behavior is, specifically: constexpr bool foo() noexcept(false) { return true; } static_assert(!noexcept(foo())); This part of the change LGTM, but could you also add a test that the function is not noexcept when it cannot do constant evaluation? |
Address review comments:
- Annotate the clang bug which the conditional compilation is avoiding.
- Assure the expression in question is not noexcept when not a constant expression.
- Cover get_type
I'd appreciate it if someone made a note to revisit this test when the clang bug is fixed, and change the #ifndef __clang__ to something like #ifndef __clang__ || clang_version < XXXX".
This LGTM.
THAT'S RIGHT, A CLANG BUG (https://llvm.org/bugs/show_bug.cgi?id=15481) THAT C1XX GETS CORRECT. You saw it here first.