From: Erik Verbruggen Date: Tue, 22 Aug 2017 10:54:40 +0000 (+0000) Subject: Revert r311442 (Fix templated type alias completion when using global completion... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=044091b728654e62444a7ea10e6efb489c705bed;p=clang Revert r311442 (Fix templated type alias completion when using global completion cache) Failing Tests (2): Clang :: CXX/dcl.dcl/dcl.spec/dcl.type/p3-0x.cpp Clang :: SemaCXX/alias-template.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311445 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index a4a1a5f3b0..07f847ca94 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -243,8 +243,7 @@ static unsigned getDeclShowContexts(const NamedDecl *ND, uint64_t Contexts = 0; if (isa(ND) || isa(ND) || - isa(ND) || isa(ND) || - isa(ND)) { + isa(ND) || isa(ND)) { // Types can appear in these contexts. if (LangOpts.CPlusPlus || !isa(ND)) Contexts |= (1LL << CodeCompletionContext::CCC_TopLevel) diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp index de54f572d8..fc1722ea6c 100644 --- a/lib/Parse/ParseTemplate.cpp +++ b/lib/Parse/ParseTemplate.cpp @@ -198,11 +198,9 @@ Parser::ParseSingleDeclarationAfterTemplate( if (Tok.is(tok::kw_using)) { // FIXME: We should return the DeclGroup to the caller. - auto usingDeclPtr = ParseUsingDirectiveOrDeclaration(Context, TemplateInfo, DeclEnd, - prefixAttrs); - if (!usingDeclPtr) - return nullptr; - return usingDeclPtr.get().getSingleDecl(); + ParseUsingDirectiveOrDeclaration(Context, TemplateInfo, DeclEnd, + prefixAttrs); + return nullptr; } // Parse the declaration specifiers, stealing any diagnostics from @@ -1025,8 +1023,8 @@ bool Parser::AnnotateTemplateIdToken(TemplateTy Template, TemplateNameKind TNK, ? OO_None : TemplateName.OperatorFunctionId.Operator; - TemplateIdAnnotation *TemplateId = TemplateIdAnnotation::Create( - SS, TemplateKWLoc, TemplateNameLoc, TemplateII, OpKind, Template, TNK, + TemplateIdAnnotation *TemplateId = TemplateIdAnnotation::Create( + SS, TemplateKWLoc, TemplateNameLoc, TemplateII, OpKind, Template, TNK, LAngleLoc, RAngleLoc, TemplateArgs, TemplateIds); Tok.setAnnotationValue(TemplateId); diff --git a/test/Index/code-completion.cpp b/test/Index/code-completion.cpp index 00f158f3d0..f52bb10a35 100644 --- a/test/Index/code-completion.cpp +++ b/test/Index/code-completion.cpp @@ -37,16 +37,6 @@ Z::operator int() const { return 0; } -template -struct Foo { T member; }; - -template using Bar = Foo; - -void test_template_alias() { - // RUN: env CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:47:1 %s | FileCheck -check-prefix=CHECK-TEMPLATE-ALIAS %s - -} - // CHECK-MEMBER: FieldDecl:{ResultType double}{TypedText member} // CHECK-MEMBER: FieldDecl:{ResultType int}{Text X::}{TypedText member} // CHECK-MEMBER: FieldDecl:{ResultType float}{Text Y::}{TypedText member} @@ -98,5 +88,3 @@ void test_template_alias() { // CHECK-EXPR-NEXT: Class name // CHECK-EXPR-NEXT: Nested name specifier // CHECK-EXPR-NEXT: Objective-C interface - -// CHECK-TEMPLATE-ALIAS: AliasTemplateDecl:{TypedText Bar}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50)