cmake: match warnings more strictly in C++ feature checks