aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2015-07-24 17:00:19 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2015-07-24 17:00:19 +0000
commitf0917ab7c12f216c4add869ac116db228590f86c (patch)
tree2024aee50f1d6e7b3057ac8ca7c14538972c45df /clang/lib/Sema/SemaCodeComplete.cpp
parentfceca9b53955e3e28bedc97fbcae4ec61c61a2d1 (diff)
downloadllvm-f0917ab7c12f216c4add869ac116db228590f86c.zip
llvm-f0917ab7c12f216c4add869ac116db228590f86c.tar.gz
llvm-f0917ab7c12f216c4add869ac116db228590f86c.tar.bz2
[code-completion] Strip outer nullability annotations when completing method implementations.
The outer nullability is transferred from the declaration to the implementation so including them is redundant. The inner ones are not transferred so they are kept to match the exact types. When we transfer the inner ones as well adding them in the implementation will become redundant and we should strip those as well. rdar://21737451 llvm-svn: 243119
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 8626527..8493674 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -7079,11 +7079,13 @@ void Sema::CodeCompleteObjCMethodDecl(Scope *S,
// If the result type was not already provided, add it to the
// pattern as (type).
- if (ReturnType.isNull())
- AddObjCPassingTypeChunk(Method->getSendResultType()
- .stripObjCKindOfType(Context),
+ if (ReturnType.isNull()) {
+ QualType ResTy = Method->getSendResultType().stripObjCKindOfType(Context);
+ AttributedType::stripOuterNullability(ResTy);
+ AddObjCPassingTypeChunk(ResTy,
Method->getObjCDeclQualifier(), Context, Policy,
Builder);
+ }
Selector Sel = Method->getSelector();
@@ -7114,6 +7116,7 @@ void Sema::CodeCompleteObjCMethodDecl(Scope *S,
ParamType = (*P)->getOriginalType();
ParamType = ParamType.substObjCTypeArgs(Context, {},
ObjCSubstitutionContext::Parameter);
+ AttributedType::stripOuterNullability(ParamType);
AddObjCPassingTypeChunk(ParamType,
(*P)->getObjCDeclQualifier(),
Context, Policy,