summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp3
-rw-r--r--clang/test/SemaObjC/protocols.m4
2 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 06f3642c271..9e0d250536f 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -1532,7 +1532,8 @@ Sema::DeclPtrTy Sema::ActOnMethodDeclaration(
Param->setInvalidDecl();
}
Param->setDeclContext(ObjCMethod);
- IdResolver.RemoveDecl(Param);
+ if (Param->getDeclName())
+ IdResolver.RemoveDecl(Param);
Params.push_back(Param);
}
diff --git a/clang/test/SemaObjC/protocols.m b/clang/test/SemaObjC/protocols.m
index 8447fe2aad2..ca38f20fbd0 100644
--- a/clang/test/SemaObjC/protocols.m
+++ b/clang/test/SemaObjC/protocols.m
@@ -61,3 +61,7 @@
@protocol B < A > // expected-error{{protocol has circular dependency}}
@end
+@protocol P
+- (int)test:(int)param, ..; // expected-warning{{type specifier missing}} \
+ // expected-error{{expected ';' after method prototype}}
+@end
OpenPOWER on IntegriCloud