summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorIlya Biryukov <ibiryukov@google.com>2018-05-14 13:50:36 +0000
committerIlya Biryukov <ibiryukov@google.com>2018-05-14 13:50:36 +0000
commitfb9dde7040988e5b5f580e74ebbeabf0fbc70651 (patch)
tree7c29a8de8029f9913a65ef963e72278fa5a580d2 /clang/lib/Sema/SemaCodeComplete.cpp
parentbf55e6dee136d081b0858f62fcc362d74a708894 (diff)
downloadbcm5719-llvm-fb9dde7040988e5b5f580e74ebbeabf0fbc70651.tar.gz
bcm5719-llvm-fb9dde7040988e5b5f580e74ebbeabf0fbc70651.zip
[CodeComplete] Provide completion in decls even for incomplete types
Summary: This change fixes lack of completions in the following case ('^'designates completion points) : void f(^); struct Incomplete; Incomplete g(^); Reviewers: bkramer, aaron.ballman, sammccall Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D46639 llvm-svn: 332244
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 4ed9d491dd3..66b48e775b2 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -4493,10 +4493,8 @@ void Sema::CodeCompleteConstructor(Scope *S, QualType Type, SourceLocation Loc,
return;
// A complete type is needed to lookup for constructors.
- if (!isCompleteType(Loc, Type))
- return;
-
- CXXRecordDecl *RD = Type->getAsCXXRecordDecl();
+ CXXRecordDecl *RD =
+ isCompleteType(Loc, Type) ? Type->getAsCXXRecordDecl() : nullptr;
if (!RD) {
CodeCompleteExpression(S, Type);
return;
OpenPOWER on IntegriCloud