This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Quick fix to remove a narrowing conversion from the in_out_result test.
ClosedPublic

Authored by var-const on Jan 11 2022, 10:29 PM.

Details

Summary

This needs a proper solution in a follow-up. The issue is that the
Standard defines conversions between in_out_result classes with
different template types as just return {in, out};. Because the
expression uses list initialization, it will fail to compile if the
conversion happens to be narrowing -- which is probably unintended.

Surprisingly, this error wasn't caught by the CI.

Diff Detail

Event Timeline

var-const requested review of this revision.Jan 11 2022, 10:29 PM
var-const created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2022, 10:29 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
This revision was not accepted when it landed; it landed in state Needs Review.Jan 12 2022, 1:50 AM
This revision was automatically updated to reflect the committed changes.