Completes the support for P1401R5
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
clang/lib/Sema/SemaOverload.cpp | ||
---|---|---|
5638–5642 | This function is checking converted constant expressions which was not touched by p1401r5, and it looks like this will break anything attempting to to contextual conversion constant expressions of type bool per http://eel.is/c++draft/expr.const#10 because it's removing the attempt to contextually convert to bool here. | |
5638–5642 | Also, I don't think P1401 was applied as a DR (but we should double check!) so I'd expect some checks for the language standard to gate the behavior. If P1401 was applied as a DR, then we should add some tests to clang/test/CXX with the proper DR markings so that our DR status page gets updated. | |
clang/test/SemaCXX/cxx2a-explicit-bool.cpp | ||
731 | Curiously, these tests already have this behavior without this patch applied: https://godbolt.org/z/13PojdWEe |
It turns out that explicit was doing the right thing (as outlined in P1401),
but noexcept was not.
I've reworked the handling of noexcept so that noexcept and explicit specifier
use the same code paths, as they have the same expected behavior and wording.
This also make sure their diagnostics are consistent.
clang/lib/Sema/SemaOverload.cpp | ||
---|---|---|
5638–5642 | It's in the air http://lists.isocpp.org/ext/2021/06/16918.php - Bur Richard took the decision to consider it as a DR |
clang/lib/Sema/SemaExceptionSpec.cpp | ||
---|---|---|
81 ↗ | (On Diff #364719) | You should just get rid of this parameter entirely if it's no longer going to be used. |
clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp | ||
879 ↗ | (On Diff #364719) | Was there a reason this test needed to change? |
clang/www/cxx_status.html | ||
1299 | We're on Clang 14 now. |
clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp | ||
---|---|---|
879 ↗ | (On Diff #364719) | yup, 2 is not convertible to bool here. I use 0+1 to keep the kind of expression the same |
clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp | ||
---|---|---|
879 ↗ | (On Diff #364719) | I kinda figured that was the case, thanks for confirming! |
- Update the release version to Clang 14 in cxx_status
- Remove unused parameter
- Remove WS only changes
I've committed on your behalf in 3c8e94bc20e5829ab5167d21d242b6b624dd934e, thank you for the fix!
This function is checking converted constant expressions which was not touched by p1401r5, and it looks like this will break anything attempting to to contextual conversion constant expressions of type bool per http://eel.is/c++draft/expr.const#10 because it's removing the attempt to contextually convert to bool here.