"'regparm' is not valid on this platform">;
def err_attribute_regparm_invalid_number : Error<
"'regparm' parameter must be between 0 and %0 inclusive">;
+def err_attribute_not_supported_in_lang : Error<
+ "%0 attribute is not supported in %select{C|C++|Objective-C}1">;
// Clang-Specific Attributes
ExpectedType
};
+namespace AttributeLangSupport {
+ enum {
+ C,
+ Cpp,
+ ObjC
+ };
+}
+
//===----------------------------------------------------------------------===//
// Helper functions
//===----------------------------------------------------------------------===//
}
static void handleUuidAttr(Sema &S, Decl *D, const AttributeList &Attr) {
+ if (!S.LangOpts.CPlusPlus) {
+ S.Diag(Attr.getLoc(), diag::err_attribute_not_supported_in_lang)
+ << Attr.getName() << AttributeLangSupport::C;
+ return;
+ }
+
if (!checkMicrosoftExt(S, Attr, S.LangOpts.Borland))
return;