__has_cpp_attribute

C++ defines set of preprocessor macro called attributes on C++11 page.
__has_cpp_attribute( attribute-token ) Checks for the presence of an attribute named by attribute-token.

#include <iostream>
using namespace std;

//depreacted introduced in (C++14)
#  if __has_cpp_attribute(unlikely)
# define TEST 10
#else
# define TEST 2
#endif

int main(){
    cout << TEST;
}