This is an archive of the discontinued LLVM Phabricator instance.

Sema: Allow scoped enums as source type for integral conversion.
Needs ReviewPublic

Authored by pcc on Mar 2 2022, 6:33 PM.

Details

Reviewers
rsmith
Summary

Fixes pr54158.

Diff Detail

Event Timeline

pcc created this revision.Mar 2 2022, 6:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2022, 6:33 PM
pcc requested review of this revision.Mar 2 2022, 6:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2022, 6:33 PM
shafik added a subscriber: shafik.Oct 13 2022, 6:05 PM

I commented on the bug report: https://github.com/llvm/llvm-project/issues/54158

I wanted to also add a note here, I don't believe this is a valid change. The example should be ill-formed as was clarified by defect report 2374

pcc added a comment.Oct 13 2022, 6:20 PM

Does that DR apply retroactively to C++17? I get the impression that "Status: C++20" means that the issue was only fixed in C++20, which would make this well-formed with -std=c++17.

Does that DR apply retroactively to C++17? I get the impression that "Status: C++20" means that the issue was only fixed in C++20, which would make this well-formed with -std=c++17.

This was simply an oversite in the wording of the paper see discussion here and this was never intended to work.

We have some discretion about how far back to apply DRs and I believe as long as applying them back does not cause major disruption we do CC @aaron.ballman

Does that DR apply retroactively to C++17? I get the impression that "Status: C++20" means that the issue was only fixed in C++20, which would make this well-formed with -std=c++17.

This was simply an oversite in the wording of the paper see discussion here and this was never intended to work.

We have some discretion about how far back to apply DRs and I believe as long as applying them back does not cause major disruption we do CC @aaron.ballman

You're correct that "Status: C++20" means that the issue was fixed in C++20. And technically speaking, we only need to apply those changes in C++20 and later. However, the intent of the DR process is to fix mistakes in older language modes. ISO doesn't let us retroactively change a published standard, so we keep this side list of "oh you should also fix this stuff" with the intent that the fixes apply as far back as they're relevant. We try to follow that guidance whenever we can, but if a DR causes code to break and that turns out to be disruptive, we'll sometimes decide to not apply it farther back than the standard version it was fixed in. I don't think there's a problem applying that specific DR as far back as we can.