Revert "cpp: made flag filtering more sane"

This reverts commit 8f7bed775a1ec1f470a9b4fd9410608a7ca106ae.