From: Douglas Gregor Date: Wed, 2 Mar 2011 00:47:37 +0000 (+0000) Subject: Push nested-name-specifier source-location information into dependent X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=059101f922de6eb765601459925f4c8914420b23;p=clang Push nested-name-specifier source-location information into dependent template specialization types. This also required some parser tweaks, since we were losing track of the nested-name-specifier's source location information in several places in the parser. Other notable changes this required: - Sema::ActOnTagTemplateIdType now type-checks and forms the appropriate type nodes (+ source-location information) for an elaborated-type-specifier ending in a template-id. Previously, we used a combination of ActOnTemplateIdType and ActOnTagTemplateIdType that resulted in an ElaboratedType wrapped around a DependentTemplateSpecializationType, which duplicated the keyword ("class", "struct", etc.) and nested-name-specifier storage. - Sema::ActOnTemplateIdType now gets a nested-name-specifier, which it places into the returned type-source location information. - Sema::ActOnDependentTag now creates types with source-location information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126808 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index 7587920976..78bd04b6bd 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -1624,8 +1624,7 @@ private: //===--------------------------------------------------------------------===// // C++ 9: classes [class] and C structs/unions. - TypeResult ParseClassName(SourceLocation &EndLocation, - CXXScopeSpec *SS = 0); + TypeResult ParseClassName(SourceLocation &EndLocation, CXXScopeSpec &SS); void ParseClassSpecifier(tok::TokenKind TagTokKind, SourceLocation TagLoc, DeclSpec &DS, const ParsedTemplateInfo &TemplateInfo = ParsedTemplateInfo(), @@ -1696,18 +1695,18 @@ private: bool ParseTemplateIdAfterTemplateName(TemplateTy Template, SourceLocation TemplateNameLoc, - const CXXScopeSpec *SS, + const CXXScopeSpec &SS, bool ConsumeLastToken, SourceLocation &LAngleLoc, TemplateArgList &TemplateArgs, SourceLocation &RAngleLoc); bool AnnotateTemplateIdToken(TemplateTy Template, TemplateNameKind TNK, - const CXXScopeSpec *SS, + CXXScopeSpec &SS, UnqualifiedId &TemplateName, SourceLocation TemplateKWLoc = SourceLocation(), bool AllowTypeAnnotation = true); - void AnnotateTemplateIdTokenAsType(const CXXScopeSpec *SS = 0); + void AnnotateTemplateIdTokenAsType(); bool IsTemplateArgumentList(unsigned Skip = 0); bool ParseTemplateArgumentList(TemplateArgList &TemplateArgs); ParsedTemplateArgument ParseTemplateTemplateArgument(); diff --git a/include/clang/Sema/ParsedTemplate.h b/include/clang/Sema/ParsedTemplate.h index 9e1a6165b1..1f572e5df4 100644 --- a/include/clang/Sema/ParsedTemplate.h +++ b/include/clang/Sema/ParsedTemplate.h @@ -139,6 +139,9 @@ namespace clang { /// tokens. All of the information about template arguments is allocated /// directly after this structure. struct TemplateIdAnnotation { + /// \brief The nested-name-specifier that precedes the template name. + CXXScopeSpec SS; + /// TemplateNameLoc - The location of the template name within the /// source. SourceLocation TemplateNameLoc; @@ -174,10 +177,13 @@ namespace clang { static TemplateIdAnnotation* Allocate(unsigned NumArgs) { TemplateIdAnnotation *TemplateId - = (TemplateIdAnnotation *)std::malloc(sizeof(TemplateIdAnnotation) + + = (TemplateIdAnnotation *)std::malloc(sizeof(TemplateIdAnnotation) + sizeof(ParsedTemplateArgument) * NumArgs); TemplateId->NumArgs = NumArgs; + // Default-construct nested-name-specifier. + new (&TemplateId->SS) CXXScopeSpec(); + // Default-construct parsed template arguments. ParsedTemplateArgument *TemplateArgs = TemplateId->getTemplateArgs(); for (unsigned I = 0; I != NumArgs; ++I) @@ -186,7 +192,10 @@ namespace clang { return TemplateId; } - void Destroy() { free(this); } + void Destroy() { + SS.~CXXScopeSpec(); + free(this); + } }; /// Retrieves the range of the given template parameter lists. diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index 161ea296e8..5ad041f67e 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -3182,17 +3182,27 @@ public: const TemplateArgumentListInfo &TemplateArgs); TypeResult - ActOnTemplateIdType(TemplateTy Template, SourceLocation TemplateLoc, + ActOnTemplateIdType(CXXScopeSpec &SS, + TemplateTy Template, SourceLocation TemplateLoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgs, SourceLocation RAngleLoc); - TypeResult ActOnTagTemplateIdType(CXXScopeSpec &SS, - TypeResult Type, - TagUseKind TUK, + /// \brief Parsed an elaborated-type-specifier that refers to a template-id, + /// such as \c class T::template apply. + /// + /// \param TUK + TypeResult ActOnTagTemplateIdType(TagUseKind TUK, TypeSpecifierType TagSpec, - SourceLocation TagLoc); + SourceLocation TagLoc, + CXXScopeSpec &SS, + TemplateTy TemplateD, + SourceLocation TemplateLoc, + SourceLocation LAngleLoc, + ASTTemplateArgsPtr TemplateArgsIn, + SourceLocation RAngleLoc); + ExprResult BuildTemplateIdExpr(const CXXScopeSpec &SS, LookupResult &R, bool RequiresADL, diff --git a/lib/AST/TypeLoc.cpp b/lib/AST/TypeLoc.cpp index ba7726b623..4f066d2de2 100644 --- a/lib/AST/TypeLoc.cpp +++ b/lib/AST/TypeLoc.cpp @@ -102,6 +102,8 @@ SourceLocation TypeLoc::getBeginLoc() const { // FIXME: Currently QualifiedTypeLoc does not have a source range // case Qualified: case Elaborated: + case DependentName: + case DependentTemplateSpecialization: break; default: TypeLoc Next = Cur.getNextTypeLoc(); diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 532c318a62..50ba7054fe 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -1013,7 +1013,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, ConsumeToken(); // The C++ scope. assert(Tok.is(tok::annot_template_id) && "ParseOptionalCXXScopeSpecifier not working"); - AnnotateTemplateIdTokenAsType(&SS); + AnnotateTemplateIdTokenAsType(); continue; } diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index 78fe4d2e31..f6344248f8 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -508,14 +508,14 @@ void Parser::ParseDecltypeSpecifier(DeclSpec &DS) { /// simple-template-id /// Parser::TypeResult Parser::ParseClassName(SourceLocation &EndLocation, - CXXScopeSpec *SS) { + CXXScopeSpec &SS) { // Check whether we have a template-id that names a type. if (Tok.is(tok::annot_template_id)) { TemplateIdAnnotation *TemplateId = static_cast(Tok.getAnnotationValue()); if (TemplateId->Kind == TNK_Type_template || TemplateId->Kind == TNK_Dependent_template_name) { - AnnotateTemplateIdTokenAsType(SS); + AnnotateTemplateIdTokenAsType(); assert(Tok.is(tok::annot_typename) && "template-id -> type failed"); ParsedType Type = getTypeAnnotation(Tok); @@ -544,7 +544,7 @@ Parser::TypeResult Parser::ParseClassName(SourceLocation &EndLocation, TemplateNameKind TNK = TNK_Type_template; TemplateTy Template; if (!Actions.DiagnoseUnknownTemplateName(*Id, IdLoc, getCurScope(), - SS, Template, TNK)) { + &SS, Template, TNK)) { Diag(IdLoc, diag::err_unknown_template_name) << Id; } @@ -561,7 +561,7 @@ Parser::TypeResult Parser::ParseClassName(SourceLocation &EndLocation, SourceLocation(), true)) return true; if (TNK == TNK_Dependent_template_name) - AnnotateTemplateIdTokenAsType(SS); + AnnotateTemplateIdTokenAsType(); // If we didn't end up with a typename token, there's nothing more we // can do. @@ -577,7 +577,7 @@ Parser::TypeResult Parser::ParseClassName(SourceLocation &EndLocation, } // We have an identifier; check whether it is actually a type. - ParsedType Type = Actions.getTypeName(*Id, IdLoc, getCurScope(), SS, true, + ParsedType Type = Actions.getTypeName(*Id, IdLoc, getCurScope(), &SS, true, false, ParsedType(), /*NonTrivialTypeSourceInfo=*/true); if (!Type) { @@ -592,7 +592,7 @@ Parser::TypeResult Parser::ParseClassName(SourceLocation &EndLocation, DeclSpec DS; DS.SetRangeStart(IdLoc); DS.SetRangeEnd(EndLocation); - DS.getTypeSpecScope() = *SS; + DS.getTypeSpecScope() = SS; const char *PrevSpec = 0; unsigned DiagID; @@ -739,7 +739,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, // a class (or template thereof). TemplateArgList TemplateArgs; SourceLocation LAngleLoc, RAngleLoc; - if (ParseTemplateIdAfterTemplateName(TemplateTy(), NameLoc, &SS, + if (ParseTemplateIdAfterTemplateName(TemplateTy(), NameLoc, SS, true, LAngleLoc, TemplateArgs, RAngleLoc)) { // We couldn't parse the template argument list at all, so don't @@ -781,7 +781,8 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, TemplateId = static_cast(Tok.getAnnotationValue()); NameLoc = ConsumeToken(); - if (TemplateId->Kind != TNK_Type_template) { + if (TemplateId->Kind != TNK_Type_template && + TemplateId->Kind != TNK_Dependent_template_name) { // The template-name in the simple-template-id refers to // something other than a class template. Give an appropriate // error message and skip to the ';'. @@ -893,15 +894,14 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, } else if (TUK == Sema::TUK_Reference || (TUK == Sema::TUK_Friend && TemplateInfo.Kind == ParsedTemplateInfo::NonTemplate)) { - TypeResult - = Actions.ActOnTemplateIdType(TemplateId->Template, - TemplateId->TemplateNameLoc, - TemplateId->LAngleLoc, - TemplateArgsPtr, - TemplateId->RAngleLoc); - - TypeResult = Actions.ActOnTagTemplateIdType(SS, TypeResult, TUK, - TagType, StartLoc); + TypeResult = Actions.ActOnTagTemplateIdType(TUK, TagType, + StartLoc, + TemplateId->SS, + TemplateId->Template, + TemplateId->TemplateNameLoc, + TemplateId->LAngleLoc, + TemplateArgsPtr, + TemplateId->RAngleLoc); } else { // This is an explicit specialization or a class template // partial specialization. @@ -1197,7 +1197,7 @@ Parser::BaseResult Parser::ParseBaseSpecifier(Decl *ClassDecl) { // Parse the class-name. SourceLocation EndLocation; - TypeResult BaseType = ParseClassName(EndLocation, &SS); + TypeResult BaseType = ParseClassName(EndLocation, SS); if (BaseType.isInvalid()) return true; @@ -1958,7 +1958,7 @@ Parser::MemInitResult Parser::ParseMemInitializer(Decl *ConstructorDecl) { = static_cast(Tok.getAnnotationValue()); if (TemplateId->Kind == TNK_Type_template || TemplateId->Kind == TNK_Dependent_template_name) { - AnnotateTemplateIdTokenAsType(&SS); + AnnotateTemplateIdTokenAsType(); assert(Tok.is(tok::annot_typename) && "template-id -> type failed"); TemplateTypeTy = getTypeAnnotation(Tok); } diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 616c251583..4a155a302f 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -904,7 +904,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression, // cast expression. CXXScopeSpec SS; ParseOptionalCXXScopeSpecifier(SS, ParsedType(), false); - AnnotateTemplateIdTokenAsType(&SS); + AnnotateTemplateIdTokenAsType(); return ParseCastExpression(isUnaryExpression, isAddressOfOperand, NotCastExpr, TypeOfCast); } diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index 0e23e43a0d..eef2f5e635 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/lib/Parse/ParseExprCXX.cpp @@ -173,7 +173,7 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS, ObjectType, EnteringContext, Template)) { - if (AnnotateTemplateIdToken(Template, TNK, &SS, TemplateName, + if (AnnotateTemplateIdToken(Template, TNK, SS, TemplateName, TemplateKWLoc, false)) return true; } else @@ -312,7 +312,7 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS, // specializations) still want to see the original template-id // token. ConsumeToken(); - if (AnnotateTemplateIdToken(Template, TNK, &SS, TemplateName, + if (AnnotateTemplateIdToken(Template, TNK, SS, TemplateName, SourceLocation(), false)) return true; continue; @@ -335,7 +335,7 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS, EnteringContext, Template)) { // Consume the identifier. ConsumeToken(); - if (AnnotateTemplateIdToken(Template, TNK, &SS, TemplateName, + if (AnnotateTemplateIdToken(Template, TNK, SS, TemplateName, SourceLocation(), false)) return true; } @@ -1164,7 +1164,7 @@ bool Parser::ParseUnqualifiedIdTemplateId(CXXScopeSpec &SS, TemplateArgList TemplateArgs; if (Tok.is(tok::less) && ParseTemplateIdAfterTemplateName(Template, Id.StartLocation, - &SS, true, LAngleLoc, + SS, true, LAngleLoc, TemplateArgs, RAngleLoc)) return true; @@ -1187,6 +1187,7 @@ bool Parser::ParseUnqualifiedIdTemplateId(CXXScopeSpec &SS, TemplateId->TemplateNameLoc = Id.StartLocation; } + TemplateId->SS = SS; TemplateId->Template = Template; TemplateId->Kind = TNK; TemplateId->LAngleLoc = LAngleLoc; @@ -1206,7 +1207,7 @@ bool Parser::ParseUnqualifiedIdTemplateId(CXXScopeSpec &SS, // Constructor and destructor names. TypeResult Type - = Actions.ActOnTemplateIdType(Template, NameLoc, + = Actions.ActOnTemplateIdType(SS, Template, NameLoc, LAngleLoc, TemplateArgsPtr, RAngleLoc); if (Type.isInvalid()) diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp index 59ced8b07f..799c617917 100644 --- a/lib/Parse/ParseTemplate.cpp +++ b/lib/Parse/ParseTemplate.cpp @@ -661,7 +661,7 @@ Parser::ParseNonTypeTemplateParameter(unsigned Depth, unsigned Position) { bool Parser::ParseTemplateIdAfterTemplateName(TemplateTy Template, SourceLocation TemplateNameLoc, - const CXXScopeSpec *SS, + const CXXScopeSpec &SS, bool ConsumeLastToken, SourceLocation &LAngleLoc, TemplateArgList &TemplateArgs, @@ -756,7 +756,7 @@ Parser::ParseTemplateIdAfterTemplateName(TemplateTy Template, /// formed, this function returns true. /// bool Parser::AnnotateTemplateIdToken(TemplateTy Template, TemplateNameKind TNK, - const CXXScopeSpec *SS, + CXXScopeSpec &SS, UnqualifiedId &TemplateName, SourceLocation TemplateKWLoc, bool AllowTypeAnnotation) { @@ -790,7 +790,8 @@ bool Parser::AnnotateTemplateIdToken(TemplateTy Template, TemplateNameKind TNK, // Build the annotation token. if (TNK == TNK_Type_template && AllowTypeAnnotation) { TypeResult Type - = Actions.ActOnTemplateIdType(Template, TemplateNameLoc, + = Actions.ActOnTemplateIdType(SS, + Template, TemplateNameLoc, LAngleLoc, TemplateArgsPtr, RAngleLoc); if (Type.isInvalid()) { @@ -803,8 +804,8 @@ bool Parser::AnnotateTemplateIdToken(TemplateTy Template, TemplateNameKind TNK, Tok.setKind(tok::annot_typename); setTypeAnnotation(Tok, Type.get()); - if (SS && SS->isNotEmpty()) - Tok.setLocation(SS->getBeginLoc()); + if (SS.isNotEmpty()) + Tok.setLocation(SS.getBeginLoc()); else if (TemplateKWLoc.isValid()) Tok.setLocation(TemplateKWLoc); else @@ -823,6 +824,7 @@ bool Parser::AnnotateTemplateIdToken(TemplateTy Template, TemplateNameKind TNK, TemplateId->Name = 0; TemplateId->Operator = TemplateName.OperatorFunctionId.Operator; } + TemplateId->SS = SS; TemplateId->Template = Template; TemplateId->Kind = TNK; TemplateId->LAngleLoc = LAngleLoc; @@ -854,7 +856,7 @@ bool Parser::AnnotateTemplateIdToken(TemplateTy Template, TemplateNameKind TNK, /// If there was a failure when forming the type from the template-id, /// a type annotation token will still be created, but will have a /// NULL type pointer to signify an error. -void Parser::AnnotateTemplateIdTokenAsType(const CXXScopeSpec *SS) { +void Parser::AnnotateTemplateIdTokenAsType() { assert(Tok.is(tok::annot_template_id) && "Requires template-id tokens"); TemplateIdAnnotation *TemplateId @@ -868,7 +870,8 @@ void Parser::AnnotateTemplateIdTokenAsType(const CXXScopeSpec *SS) { TemplateId->NumArgs); TypeResult Type - = Actions.ActOnTemplateIdType(TemplateId->Template, + = Actions.ActOnTemplateIdType(TemplateId->SS, + TemplateId->Template, TemplateId->TemplateNameLoc, TemplateId->LAngleLoc, TemplateArgsPtr, @@ -876,8 +879,8 @@ void Parser::AnnotateTemplateIdTokenAsType(const CXXScopeSpec *SS) { // Create the new "type" annotation token. Tok.setKind(tok::annot_typename); setTypeAnnotation(Tok, Type.isInvalid() ? ParsedType() : Type.get()); - if (SS && SS->isNotEmpty()) // it was a C++ qualified type name. - Tok.setLocation(SS->getBeginLoc()); + if (TemplateId->SS.isNotEmpty()) // it was a C++ qualified type name. + Tok.setLocation(TemplateId->SS.getBeginLoc()); // End location stays the same // Replace the template-id annotation token, and possible the scope-specifier diff --git a/lib/Parse/ParseTentative.cpp b/lib/Parse/ParseTentative.cpp index a603c37a53..10993276c6 100644 --- a/lib/Parse/ParseTentative.cpp +++ b/lib/Parse/ParseTentative.cpp @@ -907,7 +907,7 @@ Parser::TPResult Parser::isCXXDeclarationSpecifier() { if (TemplateId->Kind != TNK_Type_template) return TPResult::False(); CXXScopeSpec SS; - AnnotateTemplateIdTokenAsType(&SS); + AnnotateTemplateIdTokenAsType(); assert(Tok.is(tok::annot_typename)); goto case_typename; } diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index ba3c03cdfb..eb78db059e 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -1129,7 +1129,7 @@ bool Parser::TryAnnotateTypeOrScopeToken(bool EnteringContext) { Template, MemberOfUnknownSpecialization)) { // Consume the identifier. ConsumeToken(); - if (AnnotateTemplateIdToken(Template, TNK, &SS, TemplateName)) { + if (AnnotateTemplateIdToken(Template, TNK, SS, TemplateName)) { // If an unrecoverable error occurred, we need to return true here, // because the token stream is in a damaged state. We may not return // a valid identifier. @@ -1152,7 +1152,7 @@ bool Parser::TryAnnotateTypeOrScopeToken(bool EnteringContext) { // template-id annotation in a context where we weren't allowed // to produce a type annotation token. Update the template-id // annotation token to a type annotation token now. - AnnotateTemplateIdTokenAsType(&SS); + AnnotateTemplateIdTokenAsType(); return false; } } diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 61f18795ba..7d029cbd35 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -3755,7 +3755,8 @@ ExprResult Sema::ActOnPseudoDestructorExpr(Scope *S, Expr *Base, ASTTemplateArgsPtr TemplateArgsPtr(*this, TemplateId->getTemplateArgs(), TemplateId->NumArgs); - TypeResult T = ActOnTemplateIdType(TemplateId->Template, + TypeResult T = ActOnTemplateIdType(TemplateId->SS, + TemplateId->Template, TemplateId->TemplateNameLoc, TemplateId->LAngleLoc, TemplateArgsPtr, @@ -3803,7 +3804,8 @@ ExprResult Sema::ActOnPseudoDestructorExpr(Scope *S, Expr *Base, ASTTemplateArgsPtr TemplateArgsPtr(*this, TemplateId->getTemplateArgs(), TemplateId->NumArgs); - TypeResult T = ActOnTemplateIdType(TemplateId->Template, + TypeResult T = ActOnTemplateIdType(TemplateId->SS, + TemplateId->Template, TemplateId->TemplateNameLoc, TemplateId->LAngleLoc, TemplateArgsPtr, diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 16edbf76eb..0d290969db 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -1743,10 +1743,14 @@ QualType Sema::CheckTemplateIdType(TemplateName Name, } TypeResult -Sema::ActOnTemplateIdType(TemplateTy TemplateD, SourceLocation TemplateLoc, +Sema::ActOnTemplateIdType(CXXScopeSpec &SS, + TemplateTy TemplateD, SourceLocation TemplateLoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgsIn, SourceLocation RAngleLoc) { + if (SS.isInvalid()) + return true; + TemplateName Template = TemplateD.getAsVal(); // Translate the parser's template argument list in our AST format. @@ -1763,14 +1767,10 @@ Sema::ActOnTemplateIdType(TemplateTy TemplateD, SourceLocation TemplateLoc, TypeLocBuilder TLB; DependentTemplateSpecializationTypeLoc SpecTL = TLB.push(T); - SpecTL.setKeywordLoc(SourceLocation()); // FIXME: 'template' location + SpecTL.setKeywordLoc(SourceLocation()); SpecTL.setNameLoc(TemplateLoc); SpecTL.setLAngleLoc(LAngleLoc); SpecTL.setRAngleLoc(RAngleLoc); - - // FIXME: Poor nested-name-specifier source-location information. - CXXScopeSpec SS; - SS.MakeTrivial(Context, DTN->getQualifier(), TemplateLoc); SpecTL.setQualifierLoc(SS.getWithLocInContext(Context)); for (unsigned I = 0, N = SpecTL.getNumArgs(); I != N; ++I) SpecTL.setArgLocInfo(I, TemplateArgs[I].getLocInfo()); @@ -1783,56 +1783,103 @@ Sema::ActOnTemplateIdType(TemplateTy TemplateD, SourceLocation TemplateLoc, if (Result.isNull()) return true; - TypeSourceInfo *DI = Context.CreateTypeSourceInfo(Result); - TemplateSpecializationTypeLoc TL - = cast(DI->getTypeLoc()); - TL.setTemplateNameLoc(TemplateLoc); - TL.setLAngleLoc(LAngleLoc); - TL.setRAngleLoc(RAngleLoc); - for (unsigned i = 0, e = TL.getNumArgs(); i != e; ++i) - TL.setArgLocInfo(i, TemplateArgs[i].getLocInfo()); + // Build type-source information. + TypeLocBuilder TLB; + TemplateSpecializationTypeLoc SpecTL + = TLB.push(Result); + SpecTL.setTemplateNameLoc(TemplateLoc); + SpecTL.setLAngleLoc(LAngleLoc); + SpecTL.setRAngleLoc(RAngleLoc); + for (unsigned i = 0, e = SpecTL.getNumArgs(); i != e; ++i) + SpecTL.setArgLocInfo(i, TemplateArgs[i].getLocInfo()); - return CreateParsedType(Result, DI); + if (SS.isNotEmpty()) { + // Create an elaborated-type-specifier containing the nested-name-specifier. + Result = Context.getElaboratedType(ETK_None, SS.getScopeRep(), Result); + ElaboratedTypeLoc ElabTL = TLB.push(Result); + ElabTL.setKeywordLoc(SourceLocation()); + ElabTL.setQualifierLoc(SS.getWithLocInContext(Context)); + } + + return CreateParsedType(Result, TLB.getTypeSourceInfo(Context, Result)); } -TypeResult Sema::ActOnTagTemplateIdType(CXXScopeSpec &SS, - TypeResult TypeResult, - TagUseKind TUK, +TypeResult Sema::ActOnTagTemplateIdType(TagUseKind TUK, TypeSpecifierType TagSpec, - SourceLocation TagLoc) { - if (TypeResult.isInvalid()) - return ::TypeResult(); - - TypeSourceInfo *DI; - QualType Type = GetTypeFromParser(TypeResult.get(), &DI); - - // Verify the tag specifier. + SourceLocation TagLoc, + CXXScopeSpec &SS, + TemplateTy TemplateD, + SourceLocation TemplateLoc, + SourceLocation LAngleLoc, + ASTTemplateArgsPtr TemplateArgsIn, + SourceLocation RAngleLoc) { + TemplateName Template = TemplateD.getAsVal(); + + // Translate the parser's template argument list in our AST format. + TemplateArgumentListInfo TemplateArgs(LAngleLoc, RAngleLoc); + translateTemplateArguments(TemplateArgsIn, TemplateArgs); + + // Determine the tag kind TagTypeKind TagKind = TypeWithKeyword::getTagTypeKindForTypeSpec(TagSpec); + ElaboratedTypeKeyword Keyword + = TypeWithKeyword::getKeywordForTagTypeKind(TagKind); - if (const RecordType *RT = Type->getAs()) { + if (DependentTemplateName *DTN = Template.getAsDependentTemplateName()) { + QualType T = Context.getDependentTemplateSpecializationType(Keyword, + DTN->getQualifier(), + DTN->getIdentifier(), + TemplateArgs); + + // Build type-source information. + TypeLocBuilder TLB; + DependentTemplateSpecializationTypeLoc SpecTL + = TLB.push(T); + SpecTL.setKeywordLoc(TagLoc); + SpecTL.setNameLoc(TemplateLoc); + SpecTL.setLAngleLoc(LAngleLoc); + SpecTL.setRAngleLoc(RAngleLoc); + SpecTL.setQualifierLoc(SS.getWithLocInContext(Context)); + for (unsigned I = 0, N = SpecTL.getNumArgs(); I != N; ++I) + SpecTL.setArgLocInfo(I, TemplateArgs[I].getLocInfo()); + return CreateParsedType(T, TLB.getTypeSourceInfo(Context, T)); + } + + QualType Result = CheckTemplateIdType(Template, TemplateLoc, TemplateArgs); + if (Result.isNull()) + return TypeResult(); + + // Check the tag kind + if (const RecordType *RT = Result->getAs()) { RecordDecl *D = RT->getDecl(); - + IdentifierInfo *Id = D->getIdentifier(); assert(Id && "templated class must have an identifier"); - + if (!isAcceptableTagRedeclaration(D, TagKind, TagLoc, *Id)) { Diag(TagLoc, diag::err_use_with_wrong_tag) - << Type + << Result << FixItHint::CreateReplacement(SourceRange(TagLoc), D->getKindName()); Diag(D->getLocation(), diag::note_previous_use); } } - - ElaboratedTypeKeyword Keyword - = TypeWithKeyword::getKeywordForTagTypeKind(TagKind); - QualType ElabType = Context.getElaboratedType(Keyword, SS.getScopeRep(), Type); - - TypeSourceInfo *ElabDI = Context.CreateTypeSourceInfo(ElabType); - ElaboratedTypeLoc TL = cast(ElabDI->getTypeLoc()); - TL.setKeywordLoc(TagLoc); - TL.setQualifierLoc(SS.getWithLocInContext(Context)); - TL.getNamedTypeLoc().initializeFullCopy(DI->getTypeLoc()); - return CreateParsedType(ElabType, ElabDI); + + // Provide source-location information for the template specialization. + TypeLocBuilder TLB; + TemplateSpecializationTypeLoc SpecTL + = TLB.push(Result); + SpecTL.setTemplateNameLoc(TemplateLoc); + SpecTL.setLAngleLoc(LAngleLoc); + SpecTL.setRAngleLoc(RAngleLoc); + for (unsigned i = 0, e = SpecTL.getNumArgs(); i != e; ++i) + SpecTL.setArgLocInfo(i, TemplateArgs[i].getLocInfo()); + + // Construct an elaborated type containing the nested-name-specifier (if any) + // and keyword. + Result = Context.getElaboratedType(Keyword, SS.getScopeRep(), Result); + ElaboratedTypeLoc ElabTL = TLB.push(Result); + ElabTL.setKeywordLoc(TagLoc); + ElabTL.setQualifierLoc(SS.getWithLocInContext(Context)); + return CreateParsedType(Result, TLB.getTypeSourceInfo(Context, Result)); } ExprResult Sema::BuildTemplateIdExpr(const CXXScopeSpec &SS, @@ -5897,8 +5944,17 @@ Sema::ActOnDependentTag(Scope *S, unsigned TagSpec, TagUseKind TUK, return true; } + // Create the resulting type. ElaboratedTypeKeyword Kwd = TypeWithKeyword::getKeywordForTagTypeKind(Kind); - return ParsedType::make(Context.getDependentNameType(Kwd, NNS, Name)); + QualType Result = Context.getDependentNameType(Kwd, NNS, Name); + + // Create type-source location information for this type. + TypeLocBuilder TLB; + DependentNameTypeLoc TL = TLB.push(Result); + TL.setKeywordLoc(TagLoc); + TL.setQualifierLoc(SS.getWithLocInContext(Context)); + TL.setNameLoc(NameLoc); + return CreateParsedType(Result, TLB.getTypeSourceInfo(Context, Result)); } TypeResult diff --git a/test/Index/annotate-nested-name-specifier.cpp b/test/Index/annotate-nested-name-specifier.cpp index 4b97f748db..150a34af1b 100644 --- a/test/Index/annotate-nested-name-specifier.cpp +++ b/test/Index/annotate-nested-name-specifier.cpp @@ -103,12 +103,14 @@ struct X5 { template struct X6 { - typedef T type; + typedef T* type; typedef typename outer_alias::inner::vector::template rebind type1; typedef typename outer_alias::inner::vector::template rebind::other type2; + typedef class outer_alias::inner::vector::template rebind type3; + typedef class outer_alias::inner::vector::template rebind::other type4; }; -// RUN: c-index-test -test-annotate-tokens=%s:13:1:109:1 %s | FileCheck %s +// RUN: c-index-test -test-annotate-tokens=%s:13:1:111:1 %s | FileCheck %s // CHECK: Keyword: "using" [14:1 - 14:6] UsingDeclaration=vector[4:12] // CHECK: Identifier: "outer_alias" [14:7 - 14:18] NamespaceRef=outer_alias:10:11 @@ -224,9 +226,9 @@ struct X6 { // CHECK: Punctuation: "::" [57:48 - 57:50] UnexposedExpr= // CHECK: Punctuation: "~" [57:50 - 57:51] UnexposedExpr= // CHECK: Identifier: "vector" [57:51 - 57:57] TemplateRef=vector:4:12 -// CHECK: Punctuation: "<" [57:57 - 57:58] UnexposedExpr= -// CHECK: Identifier: "T" [57:58 - 57:59] UnexposedExpr= -// CHECK: Punctuation: ">" [57:59 - 57:60] UnexposedExpr= +// CHECK: Punctuation: "<" [57:57 - 57:58] CallExpr= +// CHECK: Identifier: "T" [57:58 - 57:59] CallExpr= +// CHECK: Punctuation: ">" [57:59 - 57:60] CallExpr= // CHECK: Punctuation: "(" [57:60 - 57:61] CallExpr= // CHECK: Punctuation: ")" [57:61 - 57:62] CallExpr= @@ -336,13 +338,13 @@ struct X6 { // CHECK: Punctuation: "::" [107:38 - 107:40] TypedefDecl=type1:107:76 (Definition) // CHECK: Identifier: "vector" [107:40 - 107:46] TemplateRef=vector:4:12 // CHECK: Punctuation: "<" [107:46 - 107:47] TypedefDecl=type1:107:76 (Definition) -// CHECK: Identifier: "type" [107:47 - 107:51] TypeRef=type:106:13 +// CHECK: Identifier: "type" [107:47 - 107:51] TypeRef=type:106:14 // CHECK: Punctuation: ">" [107:51 - 107:52] TypedefDecl=type1:107:76 (Definition) // CHECK: Punctuation: "::" [107:52 - 107:54] TypedefDecl=type1:107:76 (Definition) // CHECK: Keyword: "template" [107:54 - 107:62] TypedefDecl=type1:107:76 (Definition) // CHECK: Identifier: "rebind" [107:63 - 107:69] TypedefDecl=type1:107:76 (Definition) // CHECK: Punctuation: "<" [107:69 - 107:70] TypedefDecl=type1:107:76 (Definition) -// CHECK: Identifier: "type" [107:70 - 107:74] TypeRef=type:106:13 +// CHECK: Identifier: "type" [107:70 - 107:74] TypeRef=type:106:14 // CHECK: Punctuation: ">" [107:74 - 107:75] TypedefDecl=type1:107:76 (Definition) // CHECK: Identifier: "type1" [107:76 - 107:81] TypedefDecl=type1:107:76 (Definition) @@ -354,14 +356,51 @@ struct X6 { // CHECK: Punctuation: "::" [108:38 - 108:40] TypedefDecl=type2:108:83 (Definition) // CHECK: Identifier: "vector" [108:40 - 108:46] TemplateRef=vector:4:12 // CHECK: Punctuation: "<" [108:46 - 108:47] TypedefDecl=type2:108:83 (Definition) -// CHECK: Identifier: "type" [108:47 - 108:51] TypeRef=type:106:13 +// CHECK: Identifier: "type" [108:47 - 108:51] TypeRef=type:106:14 // CHECK: Punctuation: ">" [108:51 - 108:52] TypedefDecl=type2:108:83 (Definition) // CHECK: Punctuation: "::" [108:52 - 108:54] TypedefDecl=type2:108:83 (Definition) // CHECK: Keyword: "template" [108:54 - 108:62] TypedefDecl=type2:108:83 (Definition) // CHECK: Identifier: "rebind" [108:63 - 108:69] TypedefDecl=type2:108:83 (Definition) // CHECK: Punctuation: "<" [108:69 - 108:70] TypedefDecl=type2:108:83 (Definition) -// CHECK: Identifier: "type" [108:70 - 108:74] TypeRef=type:106:13 +// CHECK: Identifier: "type" [108:70 - 108:74] TypeRef=type:106:14 // CHECK: Punctuation: ">" [108:74 - 108:75] TypedefDecl=type2:108:83 (Definition) // CHECK: Punctuation: "::" [108:75 - 108:77] TypedefDecl=type2:108:83 (Definition) // CHECK: Identifier: "other" [108:77 - 108:82] TypedefDecl=type2:108:83 (Definition) // CHECK: Identifier: "type2" [108:83 - 108:88] TypedefDecl=type2:108:83 (Definition) + +// CHECK: Keyword: "typedef" [109:3 - 109:10] ClassTemplate=X6:105:8 (Definition) +// CHECK: Keyword: "class" [109:11 - 109:16] TypedefDecl=type3:109:73 (Definition) +// CHECK: Identifier: "outer_alias" [109:17 - 109:28] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [109:28 - 109:30] TypedefDecl=type3:109:73 (Definition) +// CHECK: Identifier: "inner" [109:30 - 109:35] NamespaceRef=inner:62:13 +// CHECK: Punctuation: "::" [109:35 - 109:37] TypedefDecl=type3:109:73 (Definition) +// CHECK: Identifier: "vector" [109:37 - 109:43] TemplateRef=vector:4:12 +// CHECK: Punctuation: "<" [109:43 - 109:44] TypedefDecl=type3:109:73 (Definition) +// CHECK: Identifier: "type" [109:44 - 109:48] TypeRef=type:106:14 +// CHECK: Punctuation: ">" [109:48 - 109:49] TypedefDecl=type3:109:73 (Definition) +// CHECK: Punctuation: "::" [109:49 - 109:51] TypedefDecl=type3:109:73 (Definition) +// CHECK: Keyword: "template" [109:51 - 109:59] TypedefDecl=type3:109:73 (Definition) +// CHECK: Identifier: "rebind" [109:60 - 109:66] TypedefDecl=type3:109:73 (Definition) +// CHECK: Punctuation: "<" [109:66 - 109:67] TypedefDecl=type3:109:73 (Definition) +// CHECK: Identifier: "type" [109:67 - 109:71] TypeRef=type:106:14 +// CHECK: Punctuation: ">" [109:71 - 109:72] TypedefDecl=type3:109:73 (Definition) +// CHECK: Identifier: "type3" [109:73 - 109:78] TypedefDecl=type3:109:73 (Definition) + +// CHECK: Keyword: "class" [110:11 - 110:16] TypedefDecl=type4:110:80 (Definition) +// CHECK: Identifier: "outer_alias" [110:17 - 110:28] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [110:28 - 110:30] TypedefDecl=type4:110:80 (Definition) +// CHECK: Identifier: "inner" [110:30 - 110:35] NamespaceRef=inner:62:13 +// CHECK: Punctuation: "::" [110:35 - 110:37] TypedefDecl=type4:110:80 (Definition) +// CHECK: Identifier: "vector" [110:37 - 110:43] TemplateRef=vector:4:12 +// CHECK: Punctuation: "<" [110:43 - 110:44] TypedefDecl=type4:110:80 (Definition) +// CHECK: Identifier: "type" [110:44 - 110:48] TypeRef=type:106:14 +// CHECK: Punctuation: ">" [110:48 - 110:49] TypedefDecl=type4:110:80 (Definition) +// CHECK: Punctuation: "::" [110:49 - 110:51] TypedefDecl=type4:110:80 (Definition) +// CHECK: Keyword: "template" [110:51 - 110:59] TypedefDecl=type4:110:80 (Definition) +// CHECK: Identifier: "rebind" [110:60 - 110:66] TypedefDecl=type4:110:80 (Definition) +// CHECK: Punctuation: "<" [110:66 - 110:67] TypedefDecl=type4:110:80 (Definition) +// CHECK: Identifier: "type" [110:67 - 110:71] TypeRef=type:106:14 +// CHECK: Punctuation: ">" [110:71 - 110:72] TypedefDecl=type4:110:80 (Definition) +// CHECK: Punctuation: "::" [110:72 - 110:74] TypedefDecl=type4:110:80 (Definition) +// CHECK: Identifier: "other" [110:74 - 110:79] TypedefDecl=type4:110:80 (Definition) +// CHECK: Identifier: "type4" [110:80 - 110:85] TypedefDecl=type4:110:80 (Definition) diff --git a/test/Index/recursive-cxx-member-calls.cpp b/test/Index/recursive-cxx-member-calls.cpp index f226b25b1f..c5d7bab4cc 100644 --- a/test/Index/recursive-cxx-member-calls.cpp +++ b/test/Index/recursive-cxx-member-calls.cpp @@ -679,8 +679,8 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Keyword: "const" [68:30 - 68:35] CXXMethod=getNameStart:68:15 (Definition) // CHECK-tokens: Punctuation: "{" [68:36 - 68:37] UnexposedStmt= // CHECK-tokens: Keyword: "typedef" [69:5 - 69:12] UnexposedStmt= -// CHECK-tokens: Identifier: "std" [69:13 - 69:16] UnexposedStmt= -// CHECK-tokens: Punctuation: "::" [69:16 - 69:18] UnexposedStmt= +// CHECK-tokens: Identifier: "std" [69:13 - 69:16] NamespaceRef=std:3:11 +// CHECK-tokens: Punctuation: "::" [69:16 - 69:18] TypedefDecl=actualtype:69:54 (Definition) // CHECK-tokens: Identifier: "pair" [69:18 - 69:22] TemplateRef=pair:4:44 // CHECK-tokens: Punctuation: "<" [69:23 - 69:24] TypedefDecl=actualtype:69:54 (Definition) // CHECK-tokens: Identifier: "IdentifierInfo" [69:25 - 69:39] TypeRef=class clang::IdentifierInfo:66:7 @@ -711,8 +711,8 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Keyword: "const" [72:24 - 72:29] CXXMethod=getLength:72:12 (Definition) // CHECK-tokens: Punctuation: "{" [72:30 - 72:31] UnexposedStmt= // CHECK-tokens: Keyword: "typedef" [73:5 - 73:12] UnexposedStmt= -// CHECK-tokens: Identifier: "std" [73:13 - 73:16] UnexposedStmt= -// CHECK-tokens: Punctuation: "::" [73:16 - 73:18] UnexposedStmt= +// CHECK-tokens: Identifier: "std" [73:13 - 73:16] NamespaceRef=std:3:11 +// CHECK-tokens: Punctuation: "::" [73:16 - 73:18] TypedefDecl=actualtype:73:54 (Definition) // CHECK-tokens: Identifier: "pair" [73:18 - 73:22] TemplateRef=pair:4:44 // CHECK-tokens: Punctuation: "<" [73:23 - 73:24] TypedefDecl=actualtype:73:54 (Definition) // CHECK-tokens: Identifier: "IdentifierInfo" [73:25 - 73:39] TypeRef=class clang::IdentifierInfo:66:7 @@ -951,8 +951,8 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Punctuation: ";" [103:55 - 103:56] UnexposedStmt= // CHECK-tokens: Keyword: "return" [105:3 - 105:9] UnexposedStmt= // FIXME: Missing "llvm" namespace reference below -// CHECK-tokens: Identifier: "llvm" [105:10 - 105:14] UnexposedStmt= -// CHECK-tokens: Punctuation: "::" [105:14 - 105:16] UnexposedStmt= +// CHECK-tokens: Identifier: "llvm" [105:10 - 105:14] NamespaceRef=llvm:82:11 +// CHECK-tokens: Punctuation: "::" [105:14 - 105:16] UnexposedExpr=StringSwitch:87:12 // CHECK-tokens: Identifier: "StringSwitch" [105:16 - 105:28] TemplateRef=StringSwitch:83:47 // CHECK-tokens: Punctuation: "<" [105:29 - 105:30] UnexposedExpr=StringSwitch:87:12 // CHECK-tokens: Identifier: "AttributeList" [105:31 - 105:44] TypeRef=class clang::AttributeList:12:9 @@ -1918,170 +1918,170 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK: 103:53: UnexposedExpr= Extent=[103:53 - 103:54] // CHECK: 103:53: UnexposedExpr= Extent=[103:53 - 103:54] // CHECK: 105:3: UnexposedStmt= Extent=[105:3 - 185:31] -// CHECK: 105:16: CallExpr=Default:92:5 Extent=[105:16 - 185:31] -// CHECK: 185:6: MemberRefExpr=Default:92:5 Extent=[105:16 - 185:13] -// CHECK: 105:16: UnexposedExpr=Case:88:42 Extent=[105:16 - 184:33] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 184:33] -// CHECK: 184:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 184:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 183:37] -// CHECK: 183:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 183:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 182:37] -// CHECK: 182:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 182:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 181:35] -// CHECK: 181:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 181:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 180:31] -// CHECK: 180:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 180:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 179:31] -// CHECK: 179:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 179:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 178:35] -// CHECK: 178:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 178:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 177:63] -// CHECK: 177:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 177:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 176:45] -// CHECK: 176:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 176:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 175:51] -// CHECK: 175:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 175:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 174:49] -// CHECK: 174:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 174:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 173:49] -// CHECK: 173:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 173:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 172:53] -// CHECK: 172:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 172:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 171:57] -// CHECK: 171:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 171:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 170:65] -// CHECK: 170:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 170:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 169:57] -// CHECK: 169:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 169:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 168:65] -// CHECK: 168:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 168:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 167:55] -// CHECK: 167:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 167:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 166:55] -// CHECK: 166:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 166:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 165:53] -// CHECK: 165:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 165:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 164:53] -// CHECK: 164:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 164:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 163:49] -// CHECK: 163:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 163:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 162:47] -// CHECK: 162:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 162:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 161:45] -// CHECK: 161:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 161:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 160:45] -// CHECK: 160:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 160:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 159:45] -// CHECK: 159:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 159:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 158:45] -// CHECK: 158:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 158:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 157:43] -// CHECK: 157:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 157:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 156:41] -// CHECK: 156:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 156:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 155:41] -// CHECK: 155:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 155:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 154:41] -// CHECK: 154:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 154:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 153:37] -// CHECK: 153:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 153:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 152:41] -// CHECK: 152:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 152:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 151:39] -// CHECK: 151:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 151:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 150:39] -// CHECK: 150:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 150:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 149:39] -// CHECK: 149:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 149:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 148:39] -// CHECK: 148:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 148:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 147:39] -// CHECK: 147:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 147:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 146:39] -// CHECK: 146:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 146:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 145:41] -// CHECK: 145:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 145:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 144:37] -// CHECK: 144:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 144:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 143:37] -// CHECK: 143:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 143:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 142:35] -// CHECK: 142:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 142:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 141:35] -// CHECK: 141:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 141:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 140:35] -// CHECK: 140:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 140:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 139:35] -// CHECK: 139:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 139:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 138:35] -// CHECK: 138:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 138:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 137:55] -// CHECK: 137:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 137:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 136:35] -// CHECK: 136:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 136:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 135:35] -// CHECK: 135:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 135:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 134:35] -// CHECK: 134:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 134:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 133:35] -// CHECK: 133:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 133:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 132:33] -// CHECK: 132:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 132:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 131:33] -// CHECK: 131:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 131:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 130:33] -// CHECK: 130:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 130:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 129:33] -// CHECK: 129:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 129:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 128:33] -// CHECK: 128:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 128:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 127:33] -// CHECK: 127:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 127:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 126:33] -// CHECK: 126:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 126:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 125:29] -// CHECK: 125:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 125:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 124:33] -// CHECK: 124:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 124:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 123:33] -// CHECK: 123:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 123:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 122:31] -// CHECK: 122:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 122:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 121:31] -// CHECK: 121:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 121:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 120:31] -// CHECK: 120:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 120:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 119:31] -// CHECK: 119:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 119:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 118:31] -// CHECK: 118:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 118:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 117:31] -// CHECK: 117:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 117:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 116:31] -// CHECK: 116:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 116:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 115:29] -// CHECK: 115:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 115:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 114:29] -// CHECK: 114:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 114:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 113:29] -// CHECK: 113:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 113:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 112:31] -// CHECK: 112:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 112:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 111:29] -// CHECK: 111:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 111:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 110:27] -// CHECK: 110:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 110:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 109:27] -// CHECK: 109:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 109:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 108:27] -// CHECK: 108:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 108:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 107:33] -// CHECK: 107:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 107:10] -// CHECK: 105:16: CallExpr=Case:88:42 Extent=[105:16 - 106:27] -// CHECK: 106:6: MemberRefExpr=Case:88:42 Extent=[105:16 - 106:10] -// CHECK: 105:16: UnexposedExpr=StringSwitch:87:12 Extent=[105:16 - 105:63] +// CHECK: 105:10: CallExpr=Default:92:5 Extent=[105:10 - 185:31] +// CHECK: 185:6: MemberRefExpr=Default:92:5 Extent=[105:10 - 185:13] +// CHECK: 105:10: UnexposedExpr=Case:88:42 Extent=[105:10 - 184:33] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 184:33] +// CHECK: 184:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 184:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 183:37] +// CHECK: 183:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 183:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 182:37] +// CHECK: 182:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 182:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 181:35] +// CHECK: 181:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 181:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 180:31] +// CHECK: 180:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 180:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 179:31] +// CHECK: 179:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 179:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 178:35] +// CHECK: 178:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 178:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 177:63] +// CHECK: 177:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 177:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 176:45] +// CHECK: 176:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 176:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 175:51] +// CHECK: 175:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 175:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 174:49] +// CHECK: 174:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 174:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 173:49] +// CHECK: 173:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 173:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 172:53] +// CHECK: 172:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 172:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 171:57] +// CHECK: 171:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 171:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 170:65] +// CHECK: 170:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 170:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 169:57] +// CHECK: 169:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 169:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 168:65] +// CHECK: 168:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 168:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 167:55] +// CHECK: 167:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 167:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 166:55] +// CHECK: 166:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 166:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 165:53] +// CHECK: 165:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 165:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 164:53] +// CHECK: 164:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 164:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 163:49] +// CHECK: 163:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 163:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 162:47] +// CHECK: 162:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 162:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 161:45] +// CHECK: 161:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 161:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 160:45] +// CHECK: 160:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 160:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 159:45] +// CHECK: 159:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 159:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 158:45] +// CHECK: 158:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 158:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 157:43] +// CHECK: 157:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 157:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 156:41] +// CHECK: 156:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 156:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 155:41] +// CHECK: 155:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 155:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 154:41] +// CHECK: 154:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 154:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 153:37] +// CHECK: 153:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 153:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 152:41] +// CHECK: 152:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 152:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 151:39] +// CHECK: 151:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 151:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 150:39] +// CHECK: 150:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 150:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 149:39] +// CHECK: 149:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 149:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 148:39] +// CHECK: 148:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 148:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 147:39] +// CHECK: 147:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 147:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 146:39] +// CHECK: 146:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 146:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 145:41] +// CHECK: 145:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 145:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 144:37] +// CHECK: 144:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 144:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 143:37] +// CHECK: 143:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 143:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 142:35] +// CHECK: 142:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 142:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 141:35] +// CHECK: 141:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 141:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 140:35] +// CHECK: 140:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 140:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 139:35] +// CHECK: 139:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 139:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 138:35] +// CHECK: 138:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 138:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 137:55] +// CHECK: 137:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 137:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 136:35] +// CHECK: 136:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 136:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 135:35] +// CHECK: 135:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 135:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 134:35] +// CHECK: 134:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 134:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 133:35] +// CHECK: 133:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 133:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 132:33] +// CHECK: 132:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 132:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 131:33] +// CHECK: 131:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 131:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 130:33] +// CHECK: 130:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 130:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 129:33] +// CHECK: 129:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 129:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 128:33] +// CHECK: 128:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 128:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 127:33] +// CHECK: 127:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 127:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 126:33] +// CHECK: 126:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 126:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 125:29] +// CHECK: 125:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 125:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 124:33] +// CHECK: 124:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 124:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 123:33] +// CHECK: 123:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 123:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 122:31] +// CHECK: 122:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 122:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 121:31] +// CHECK: 121:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 121:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 120:31] +// CHECK: 120:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 120:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 119:31] +// CHECK: 119:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 119:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 118:31] +// CHECK: 118:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 118:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 117:31] +// CHECK: 117:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 117:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 116:31] +// CHECK: 116:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 116:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 115:29] +// CHECK: 115:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 115:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 114:29] +// CHECK: 114:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 114:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 113:29] +// CHECK: 113:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 113:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 112:31] +// CHECK: 112:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 112:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 111:29] +// CHECK: 111:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 111:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 110:27] +// CHECK: 110:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 110:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 109:27] +// CHECK: 109:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 109:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 108:27] +// CHECK: 108:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 108:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 107:33] +// CHECK: 107:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 107:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 106:27] +// CHECK: 106:6: MemberRefExpr=Case:88:42 Extent=[105:10 - 106:10] +// CHECK: 105:10: UnexposedExpr=StringSwitch:87:12 Extent=[105:10 - 105:63] // CHECK: 105:16: TemplateRef=StringSwitch:83:47 Extent=[105:16 - 105:28] -// CHECK: 105:16: CallExpr=StringSwitch:87:12 Extent=[105:16 - 105:62] +// CHECK: 105:10: CallExpr=StringSwitch:87:12 Extent=[105:10 - 105:62] // CHECK: 105:54: CallExpr=StringRef:38:7 Extent=[105:54 - 105:62] // CHECK: 105:54: UnexposedExpr=AttrName:101:19 Extent=[105:54 - 105:62] // CHECK: 105:54: DeclRefExpr=AttrName:101:19 Extent=[105:54 - 105:62] diff --git a/test/SemaCXX/nested-name-spec-locations.cpp b/test/SemaCXX/nested-name-spec-locations.cpp index 841937afc2..d543f335e7 100644 --- a/test/SemaCXX/nested-name-spec-locations.cpp +++ b/test/SemaCXX/nested-name-spec-locations.cpp @@ -110,3 +110,21 @@ struct DependentTemplateSpecializationTypeTester2 { }; DependentTemplateSpecializationTypeTester2 DTSTCheck2; // expected-note{{in instantiation of template class}} + +template +struct DependentTemplateSpecializationTypeTester3 : + T::template apply::type + * // expected-error{{declared as a pointer to a reference of type}} + > +{}; + +DependentTemplateSpecializationTypeTester3 DTSTCheck3; // expected-note{{in instantiation of template class}} + +template +struct DependentTemplateSpecializationTypeTester4 { + typedef class T::template apply::type + * // expected-error{{declared as a pointer to a reference of type}} + > type; +}; + +DependentTemplateSpecializationTypeTester4 DTSTCheck4; // expected-note{{in instantiation of template class}} diff --git a/test/SemaTemplate/deduction-crash.cpp b/test/SemaTemplate/deduction-crash.cpp index 8f4b728181..1860c7577c 100644 --- a/test/SemaTemplate/deduction-crash.cpp +++ b/test/SemaTemplate/deduction-crash.cpp @@ -4,7 +4,7 @@ // Note that the error count below doesn't matter. We just want to // make sure that the parser doesn't crash. -// CHECK: 15 errors +// CHECK: 16 errors template struct int_;