This is an archive of the discontinued LLVM Phabricator instance.

The controlling expression for _Generic is unevaluated
ClosedPublic

Authored by aaron.ballman on Feb 22 2016, 7:52 AM.

Details

Reviewers
rsmith
Summary

In r252104, I fixed a _Generic bug so that the controlling expression has its type decayed and qualifiers stripped. However, this caused a diagnostic regression because the controlling expression is not evaluated, and my fix triggered diagnostics (like null pointer dereferences) that it should not have. This patch fixes the regression by putting the evaluation of the controlling expression into an unevaluated context before decaying and stripping qualifiers.

Assuming this patch is acceptable, I think it should go into 3.8 as well.

Diff Detail

Event Timeline

aaron.ballman retitled this revision from to The controlling expression for _Generic is unevaluated.
aaron.ballman updated this object.
aaron.ballman added a reviewer: rsmith.
aaron.ballman added a subscriber: cfe-commits.
rsmith accepted this revision.Feb 23 2016, 10:54 AM
rsmith edited edge metadata.

LGTM for trunk and 3.8.

This revision is now accepted and ready to land.Feb 23 2016, 10:54 AM

Thanks! I've commit in r261669.