Add a new attribute meta-spelling called "GCC" -- it widens into being a GNU spelling, and a CXX11 spelling with the namespace "gnu". It also sets a bit on the spelling certifying that it is known to GCC. From this, we can warn about the extension appropriately. As a consequence, the FunctionDefinition functionality is completely removed.
Replacing the functionality from r199676, which didn't solve the problem as elegantly.
llvm-svn: 200252
diff --git a/clang/lib/Sema/AttributeList.cpp b/clang/lib/Sema/AttributeList.cpp
index aa6f72b..7258b37 100644
--- a/clang/lib/Sema/AttributeList.cpp
+++ b/clang/lib/Sema/AttributeList.cpp
@@ -150,7 +150,7 @@
unsigned HasCustomParsing : 1;
unsigned IsTargetSpecific : 1;
unsigned IsType : 1;
- unsigned CanAppearOnFuncDef : 1;
+ unsigned IsKnownToGCC : 1;
bool (*DiagAppertainsToDecl)(Sema &S, const AttributeList &Attr,
const Decl *);
@@ -199,8 +199,8 @@
return getInfo(*this).ExistsInTarget(T);
}
-bool AttributeList::canAppearOnFunctionDefinition() const {
- return getInfo(*this).CanAppearOnFuncDef;
+bool AttributeList::isKnownToGCC() const {
+ return getInfo(*this).IsKnownToGCC;
}
unsigned AttributeList::getSemanticSpelling() const {