Fixing the qualifiers check from PR49733.
It would be great to add some test, to increase the coverage, and because the erroneous check doesn't seem to trigger in any tests.
However I couldn't come up with a case that did trigger it, so it may be that it can't happen, or at least is very unlikely.
Fixes: PR49733