Revert r197496, as it broke REVERTIBLE_TYPE_TRAITs from PCH files.

Also add a test to make sure that this doesn't break again. Fixes PR21036.