Page MenuHomePhabricator

[LLVM][Casting.h] Add trivial self-cast
ClosedPublic

Authored by bzcheeseman on Fri, May 13, 3:50 PM.

Details

Summary

Casting from a type to itself should always be possible. Make this simple for all users, and add tests to ensure we keep being able to do this. Ref: https://reviews.llvm.org/D125543

Diff Detail

Event Timeline

bzcheeseman created this revision.Fri, May 13, 3:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptFri, May 13, 3:50 PM
bzcheeseman requested review of this revision.Fri, May 13, 3:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptFri, May 13, 3:50 PM

The test failures look real here, can you take a look? Looks like this doesn't properly handle the non-const case.

The test failures look real here, can you take a look? Looks like this doesn't properly handle the non-const case.

Yeah agreed - I'll take a look when I get a chance.

bzcheeseman edited the summary of this revision. (Show Details)

Found a better way to do it (I think) that avoids yet another partial specialization of CastInfo to avoid future ambiguous partial specialization shenanigans.

rriddle accepted this revision.Sun, May 15, 10:06 PM
This revision is now accepted and ready to land.Sun, May 15, 10:06 PM
This revision was automatically updated to reflect the committed changes.