OSDN Git Service

Return false from __has_declspec_attribute() if not explicitly enabled
authorTimm Bäder <tbaeder@redhat.com>
Tue, 12 Jan 2021 18:18:13 +0000 (13:18 -0500)
committerAaron Ballman <aaron@aaronballman.com>
Tue, 12 Jan 2021 18:20:08 +0000 (13:20 -0500)
commitef3800e82169c674219501d9ac09ef12b28e6359
tree471cb9171afffd55fb3a27a6361745a783b4967c
parentb117d17d264f448e0b037a62f5a48ec9aedd886c
Return false from __has_declspec_attribute() if not explicitly enabled

Currently, projects can check for __has_declspec_attribute() and use
it accordingly, but the check for __has_declspec_attribute will return
true even if declspec attributes are not enabled for the target.

This changes Clang to instead return false when declspec attributes are
not supported for the target.
clang/lib/Lex/PPMacroExpansion.cpp