Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 044091b

Browse files
committed
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
1 parent b97715b commit 044091b

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

lib/Frontend/ASTUnit.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,7 @@ static unsigned getDeclShowContexts(const NamedDecl *ND,
243243

244244
uint64_t Contexts = 0;
245245
if (isa<TypeDecl>(ND) || isa<ObjCInterfaceDecl>(ND) ||
246-
isa<ClassTemplateDecl>(ND) || isa<TemplateTemplateParmDecl>(ND) ||
247-
isa<TypeAliasTemplateDecl>(ND)) {
246+
isa<ClassTemplateDecl>(ND) || isa<TemplateTemplateParmDecl>(ND)) {
248247
// Types can appear in these contexts.
249248
if (LangOpts.CPlusPlus || !isa<TagDecl>(ND))
250249
Contexts |= (1LL << CodeCompletionContext::CCC_TopLevel)

lib/Parse/ParseTemplate.cpp

+5-7
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,9 @@ Parser::ParseSingleDeclarationAfterTemplate(
198198

199199
if (Tok.is(tok::kw_using)) {
200200
// FIXME: We should return the DeclGroup to the caller.
201-
auto usingDeclPtr = ParseUsingDirectiveOrDeclaration(Context, TemplateInfo, DeclEnd,
202-
prefixAttrs);
203-
if (!usingDeclPtr)
204-
return nullptr;
205-
return usingDeclPtr.get().getSingleDecl();
201+
ParseUsingDirectiveOrDeclaration(Context, TemplateInfo, DeclEnd,
202+
prefixAttrs);
203+
return nullptr;
206204
}
207205

208206
// Parse the declaration specifiers, stealing any diagnostics from
@@ -1025,8 +1023,8 @@ bool Parser::AnnotateTemplateIdToken(TemplateTy Template, TemplateNameKind TNK,
10251023
? OO_None
10261024
: TemplateName.OperatorFunctionId.Operator;
10271025

1028-
TemplateIdAnnotation *TemplateId = TemplateIdAnnotation::Create(
1029-
SS, TemplateKWLoc, TemplateNameLoc, TemplateII, OpKind, Template, TNK,
1026+
TemplateIdAnnotation *TemplateId = TemplateIdAnnotation::Create(
1027+
SS, TemplateKWLoc, TemplateNameLoc, TemplateII, OpKind, Template, TNK,
10301028
LAngleLoc, RAngleLoc, TemplateArgs, TemplateIds);
10311029

10321030
Tok.setAnnotationValue(TemplateId);

test/Index/code-completion.cpp

-12
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,6 @@ Z::operator int() const {
3737
return 0;
3838
}
3939

40-
template <typename T>
41-
struct Foo { T member; };
42-
43-
template<typename T> using Bar = Foo<T>;
44-
45-
void test_template_alias() {
46-
// RUN: env CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:47:1 %s | FileCheck -check-prefix=CHECK-TEMPLATE-ALIAS %s
47-
48-
}
49-
5040
// CHECK-MEMBER: FieldDecl:{ResultType double}{TypedText member}
5141
// CHECK-MEMBER: FieldDecl:{ResultType int}{Text X::}{TypedText member}
5242
// CHECK-MEMBER: FieldDecl:{ResultType float}{Text Y::}{TypedText member}
@@ -98,5 +88,3 @@ void test_template_alias() {
9888
// CHECK-EXPR-NEXT: Class name
9989
// CHECK-EXPR-NEXT: Nested name specifier
10090
// CHECK-EXPR-NEXT: Objective-C interface
101-
102-
// CHECK-TEMPLATE-ALIAS: AliasTemplateDecl:{TypedText Bar}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50)

0 commit comments

Comments
 (0)