Skip to content

Fix is_convertible_without_narrowing for corner cases - #57

Merged
saki7 merged 1 commit into
mainfrom
fix-convertible-without-narrowing
Aug 9, 2026
Merged

Fix is_convertible_without_narrowing for corner cases#57
saki7 merged 1 commit into
mainfrom
fix-convertible-without-narrowing

Conversation

@saki7

@saki7 saki7 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Follow-up for #54

This PR addresses corner cases mentioned in https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p0870r8.html#ch6.


Note: there's one minor case that is unfixable right now; this specific case (also mentioned in the paper) cannot be handled because GCC/Clang and MSVC(2026) currently disagree.

Although the paper's author "believes" this should return true, it is technically undecided right now; LWG decision (not LEWG decision) is needed.

STATIC_CHECK(iris::is_convertible_without_narrowing_v<std::integral_constant<int, 42>, float>);

@saki7 saki7 self-assigned this Aug 9, 2026
@saki7 saki7 added bug Something isn't working language-lawyer Implies unclear specification on the C++ standard, or potential misinterpretation/bug on compilers upstream-workaround Temporary workaround for upstream defects. This must be reviewed and reverted later, if possible labels Aug 9, 2026
@cppwarningnotifier

Copy link
Copy Markdown
EnvironmentC++23C++26
irisClang21Debug✅success✅success
Release✅success✅success
GCC14Debug✅success✅success
Release✅success✅success
MSVC2026Debug✅success✅success
Release✅success✅success

@saki7
saki7 merged commit 590e890 into main Aug 9, 2026
26 checks passed
@saki7
saki7 deleted the fix-convertible-without-narrowing branch August 9, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working language-lawyer Implies unclear specification on the C++ standard, or potential misinterpretation/bug on compilers upstream-workaround Temporary workaround for upstream defects. This must be reviewed and reverted later, if possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant