diff options
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 2 | ||||
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 3 | ||||
-rw-r--r-- | test/SemaObjC/check-dup-objc-decls-1.m | 2 | ||||
-rw-r--r-- | test/SemaObjC/protocol-test-2.m | 2 |
4 files changed, 4 insertions, 5 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index b51162ae94..ddb066e3d6 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -128,7 +128,7 @@ def err_undef_superclass : Error< def warn_previous_alias_decl : Warning<"previously declared alias is ignored">; def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">; def warn_undef_interface : Warning<"cannot find interface declaration for %0">; -def err_duplicate_protocol_def : Error<"duplicate protocol definition of %0">; +def warn_duplicate_protocol_def : Warning<"duplicate protocol definition of %0 is ignored">; def err_protocol_has_circular_dependency : Error< "protocol has circular dependency">; def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">; diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 0103393ddc..17de0a5067 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -246,8 +246,7 @@ Sema::ActOnStartProtocolInterface(SourceLocation AtProtoInterfaceLoc, if (PDecl) { // Protocol already seen. Better be a forward protocol declaration if (!PDecl->isForwardDecl()) { - PDecl->setInvalidDecl(); - Diag(ProtocolLoc, diag::err_duplicate_protocol_def) << ProtocolName; + Diag(ProtocolLoc, diag::warn_duplicate_protocol_def) << ProtocolName; Diag(PDecl->getLocation(), diag::note_previous_definition); // Just return the protocol we already had. // FIXME: don't leak the objects passed in! diff --git a/test/SemaObjC/check-dup-objc-decls-1.m b/test/SemaObjC/check-dup-objc-decls-1.m index 4181ac097b..dc9c8f4426 100644 --- a/test/SemaObjC/check-dup-objc-decls-1.m +++ b/test/SemaObjC/check-dup-objc-decls-1.m @@ -33,7 +33,7 @@ void Gorf() // expected-error {{redefinition of 'Gorf' as different kind of symb @interface A<Q> @end // expected-error {{duplicate interface definition for class 'A'}} @protocol PP<P> @end // expected-note {{previous definition is here}} -@protocol PP<Q> @end // expected-error {{duplicate protocol definition of 'PP'}} +@protocol PP<Q> @end // expected-warning {{duplicate protocol definition of 'PP'}} @interface A(Cat)<P> @end // expected-note {{previous definition is here}} @interface A(Cat)<Q> @end // expected-warning {{duplicate definition of category 'Cat' on interface 'A'}} diff --git a/test/SemaObjC/protocol-test-2.m b/test/SemaObjC/protocol-test-2.m index a882809f1c..3abb9b5935 100644 --- a/test/SemaObjC/protocol-test-2.m +++ b/test/SemaObjC/protocol-test-2.m @@ -18,7 +18,7 @@ @protocol PROTO<p1> // expected-note {{previous definition is here}} @end -@protocol PROTO<p1> // expected-error {{duplicate protocol definition of 'PROTO'}} +@protocol PROTO<p1> // expected-warning {{duplicate protocol definition of 'PROTO'}} @end @protocol PROTO3<p1, p1> |