diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index b2a6b4bb41ff..ea514d382682 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -1580,6 +1580,7 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(Declarator &D, if (Tok.is(tok::code_completion)) { Actions.CodeCompleteInitializer(getCurScope(), ThisDecl); + Actions.FinalizeDeclaration(ThisDecl); cutOffParsing(); return 0; } diff --git a/clang/test/CodeCompletion/auto.cpp b/clang/test/CodeCompletion/auto.cpp new file mode 100644 index 000000000000..1fc9fb035d47 --- /dev/null +++ b/clang/test/CodeCompletion/auto.cpp @@ -0,0 +1,2 @@ +// RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:2:9 %s +auto i =