r311445 - Revert r311442 (Fix templated type alias completion when using global completion cache)
Erik Verbruggen via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 22 03:54:41 PDT 2017
Author: erikjv
Date: Tue Aug 22 03:54:40 2017
New Revision: 311445
URL: http://llvm.org/viewvc/llvm-project?rev=311445&view=rev
Log:
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
Modified:
cfe/trunk/lib/Frontend/ASTUnit.cpp
cfe/trunk/lib/Parse/ParseTemplate.cpp
cfe/trunk/test/Index/code-completion.cpp
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=311445&r1=311444&r2=311445&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Tue Aug 22 03:54:40 2017
@@ -243,8 +243,7 @@ static unsigned getDeclShowContexts(cons
uint64_t Contexts = 0;
if (isa<TypeDecl>(ND) || isa<ObjCInterfaceDecl>(ND) ||
- isa<ClassTemplateDecl>(ND) || isa<TemplateTemplateParmDecl>(ND) ||
- isa<TypeAliasTemplateDecl>(ND)) {
+ isa<ClassTemplateDecl>(ND) || isa<TemplateTemplateParmDecl>(ND)) {
// Types can appear in these contexts.
if (LangOpts.CPlusPlus || !isa<TagDecl>(ND))
Contexts |= (1LL << CodeCompletionContext::CCC_TopLevel)
Modified: cfe/trunk/lib/Parse/ParseTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTemplate.cpp?rev=311445&r1=311444&r2=311445&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTemplate.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTemplate.cpp Tue Aug 22 03:54:40 2017
@@ -198,11 +198,9 @@ Parser::ParseSingleDeclarationAfterTempl
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(Tem
? 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);
Modified: cfe/trunk/test/Index/code-completion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/code-completion.cpp?rev=311445&r1=311444&r2=311445&view=diff
==============================================================================
--- cfe/trunk/test/Index/code-completion.cpp (original)
+++ cfe/trunk/test/Index/code-completion.cpp Tue Aug 22 03:54:40 2017
@@ -37,16 +37,6 @@ Z::operator int() const {
return 0;
}
-template <typename T>
-struct Foo { T member; };
-
-template<typename T> using Bar = Foo<T>;
-
-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)
More information about the cfe-commits
mailing list