In commit r303930 (Switch from using a DiagnosticTrap and a note...,
2017-05-25) use of DiagnosticErrorTrap was removed because it was no
longer needed to detect whether to add a diagnostic note. However, the
trap was also necessary to correctly detect and mark invalid special
members under Sema.getDiagnostics().setSuppressAllDiagnostics(true).
Restore use of the trap to fix semantic checking when diagnostics are
suppressed.
This is useful for external tools that need to detect the set of valid
special members without issuing diagnostics on the invalid ones.
Add a unit test that does this and verifies the results.