Rebase of #1463

This is a rebase of #1463 on master.  I think #1463 is failing because of some bugs with warning testing that have since been fixed on master, and this PR is to test that theory before merging it.