Major New Features
------------------
-- A big one.
+- The __has_attribute built-in macro no longer queries for attributes across
+ multiple attribute syntaxes (GNU, C++11, __declspec, etc). Instead, it only
+ queries GNU-style attributes. With the addition of __has_cpp_attribute and
+ __has_declspec_attribute, this allows for more precise coverage of attribute
+ syntax querying.
Improvements to Clang's diagnostics
class IdentifierInfo;
enum class AttrSyntax {
- /// Is the attribute identifier generally known for any syntax?
- Generic,
/// Is the identifier known as a GNU-style attribute?
GNU,
/// Is the identifier known as a __declspec-style attribute?
// Check for a builtin is trivial.
Value = FeatureII->getBuiltinID() != 0;
} else if (II == Ident__has_attribute)
- Value = hasAttribute(AttrSyntax::Generic, nullptr, FeatureII,
+ Value = hasAttribute(AttrSyntax::GNU, nullptr, FeatureII,
getTargetInfo().getTriple(), getLangOpts());
else if (II == Ident__has_cpp_attribute)
Value = hasAttribute(AttrSyntax::CXX, ScopeII, FeatureII,
#if !__has_attribute(dllexport)
int does_not_have_dllexport();
#endif
+
+// CHECK: does_not_have_uuid
+#if !__has_attribute(uuid)
+ int does_not_have_uuid
+#endif
}
OS << "switch (Syntax) {\n";
- OS << "case AttrSyntax::Generic:\n";
- OS << " return llvm::StringSwitch<int>(Name)\n";
- GenerateHasAttrSpellingStringSwitch(Attrs, OS);
OS << "case AttrSyntax::GNU:\n";
OS << " return llvm::StringSwitch<int>(Name)\n";
GenerateHasAttrSpellingStringSwitch(GNU, OS, "GNU");