diff options
| -rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.td | 4 | ||||
| -rw-r--r-- | clang/include/clang/Sema/AttributeList.h | 3 | ||||
| -rw-r--r-- | clang/utils/TableGen/ClangAttrEmitter.cpp | 5 |
3 files changed, 8 insertions, 4 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 23339fe7ef1..ddfac336ded 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -2038,7 +2038,7 @@ def warn_attribute_wrong_decl_type : Warning< "types and namespaces|Objective-C interfaces|methods and properties|" "struct or union|struct, union or class|types|" "Objective-C instance methods|init methods of interface declarations|" - "variables, functions and classes}1">, + "variables, functions and classes|Objective-C protocols}1">, InGroup<IgnoredAttributes>; def err_attribute_wrong_decl_type : Error< "%0 attribute only applies to %select{functions|unions|" @@ -2051,7 +2051,7 @@ def err_attribute_wrong_decl_type : Error< "types and namespaces|Objective-C interfaces|methods and properties|" "struct or union|struct, union or class|types|" "Objective-C instance methods|init methods of interface declarations|" - "variables, functions and classes}1">; + "variables, functions and classes|Objective-C protocols}1">; def warn_type_attribute_wrong_type : Warning< "'%0' only applies to %select{function|pointer|" "Objective-C object or block pointer}1 types; type here is %2">, diff --git a/clang/include/clang/Sema/AttributeList.h b/clang/include/clang/Sema/AttributeList.h index f661dd08739..9d870a22c2f 100644 --- a/clang/include/clang/Sema/AttributeList.h +++ b/clang/include/clang/Sema/AttributeList.h @@ -910,7 +910,8 @@ enum AttributeDeclKind { ExpectedType, ExpectedObjCInstanceMethod, ExpectedObjCInterfaceDeclInitMethod, - ExpectedFunctionVariableOrClass + ExpectedFunctionVariableOrClass, + ExpectedObjectiveCProtocol }; } // end namespace clang diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp index 395400ea854..21920644f39 100644 --- a/clang/utils/TableGen/ClangAttrEmitter.cpp +++ b/clang/utils/TableGen/ClangAttrEmitter.cpp @@ -1723,7 +1723,8 @@ static std::string CalculateDiagnostic(const Record &S) { Namespace = 1U << 11, FuncTemplate = 1U << 12, Field = 1U << 13, - CXXMethod = 1U << 14 + CXXMethod = 1U << 14, + ObjCProtocol = 1U << 15 }; uint32_t SubMask = 0; @@ -1752,6 +1753,7 @@ static std::string CalculateDiagnostic(const Record &S) { .Case("ObjCProperty", ObjCProp) .Case("Record", GenericRecord) .Case("ObjCInterface", ObjCInterface) + .Case("ObjCProtocol", ObjCProtocol) .Case("Block", Block) .Case("CXXRecord", Class) .Case("Namespace", Namespace) @@ -1783,6 +1785,7 @@ static std::string CalculateDiagnostic(const Record &S) { case ObjCMethod: return "ExpectedMethod"; case Type: return "ExpectedType"; case ObjCInterface: return "ExpectedObjectiveCInterface"; + case ObjCProtocol: return "ExpectedObjectiveCProtocol"; // "GenericRecord" means struct, union or class; check the language options // and if not compiling for C++, strip off the class part. Note that this |

