Currently, projects can check for __has_declspec_attribute() and use it accordingly, like so:
#if __has_declspec_attribute(noreturn) __declspec(noreturn) #endif static void foo(void) {}
(with maybe an additional defined(__has_declspec_attribute) check around).
However, clang will by default accept this code and return true for __has_declspec_attribute(noreturn), just to error out because declspec attributes have not been enabled explicitly:
~ ❯ clang ./declspec.c ./declspec.c:3:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes __declspec(noreturn) ^ 1 error generated.
I think it would be better if clang simply returned false for __has_declspec_attribute() checks if declspec attributes have not been enabled.