Page MenuHomePhabricator

[Sema] Warn about unused variables if we can constant evaluate the initializer.

Authored by bkramer on Oct 8 2017, 3:33 PM.



If the variable construction can be constant evaluated it doesn't have
side effects, so removing it is always safe. We only try to evaluate
variables that are unused, there should be no impact on compile time.

Diff Detail


Event Timeline

bkramer created this revision.Oct 8 2017, 3:33 PM
rsmith accepted this revision.Oct 13 2017, 5:36 PM

Cunning, I like it :)

This revision is now accepted and ready to land.Oct 13 2017, 5:36 PM
This revision was automatically updated to reflect the committed changes.

Excuse me, I have reverted it in rL315806. check-libcxx dislikes it.

See also;

For the record, this found 5 actual useless variables in Firefox code.