Fix bug causing clang unused arguments to not get filtered out

Fixes bug that caused all the flags found in #27549 to not get filtered out properly. This causes issues #27746, #27736 and others related to the unused flags clang update to be fixed.