(cherry picked from commit 0e2cc7851f556e928e52bb2886c7d60c13b0741e)
Log removal of invalid definitions as warnings
(cherry picked from commit 3d61719a2cc9c87ac3c92b5358bb5034aed4c2ff)
(cherry picked from commit 498722b240c17d310863ed604c441a9c507ddcd6)