Guard a feature that unsupported by old GCC
As @david2050 commented, changes introduced by https://reviews.llvm.org/D56397 break builds for older compilers
which don't support __has(_cpp)_attribute. This is a fix for the break.
Reviewers: protze.joachim, jlpeyton, AndreyChurbanov, Hahnfeld, david2050
Subscribers: openmp-commits, david2050
Differential Revision: https://reviews.llvm.org/D57851