- Document the valid states: invalid/unset/pointer (Currently both documentation and implementation strongly suggest that pointer+invalid is poissible, when it's not)
- Remove unused set() functions, which had different semantics between the compressed/uncompressed specialization! (The former allowing escaping the tristate into pointer+invalid)
- Make the compressed specialization's internals directly model the tristate, rather than pretending pointer + invalid were independent.
- Make members of each version identical where possible, remove repetition
- fix operator= accidentally returning a const reference
- Fix indentation :-)
This was motivated by D157868, in which an experienced clang dev was
confused about the possible states for ExprResult - and I vividly
remember getting very confused about this myself.
It might be worth tying this to usable.