[cfe-commits] r126808 - in /cfe/trunk: include/clang/Parse/ include/clang/Sema/ lib/AST/ lib/Parse/ lib/Sema/ test/Index/ test/SemaCXX/ test/SemaTemplate/

Douglas Gregor dgregor at apple.com
Tue Mar 1 16:47:38 PST 2011


Author: dgregor
Date: Tue Mar  1 18:47:37 2011
New Revision: 126808

URL: http://llvm.org/viewvc/llvm-project?rev=126808&view=rev
Log:
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.



Modified:
    cfe/trunk/include/clang/Parse/Parser.h
    cfe/trunk/include/clang/Sema/ParsedTemplate.h
    cfe/trunk/include/clang/Sema/Sema.h
    cfe/trunk/lib/AST/TypeLoc.cpp
    cfe/trunk/lib/Parse/ParseDecl.cpp
    cfe/trunk/lib/Parse/ParseDeclCXX.cpp
    cfe/trunk/lib/Parse/ParseExpr.cpp
    cfe/trunk/lib/Parse/ParseExprCXX.cpp
    cfe/trunk/lib/Parse/ParseTemplate.cpp
    cfe/trunk/lib/Parse/ParseTentative.cpp
    cfe/trunk/lib/Parse/Parser.cpp
    cfe/trunk/lib/Sema/SemaExprCXX.cpp
    cfe/trunk/lib/Sema/SemaTemplate.cpp
    cfe/trunk/test/Index/annotate-nested-name-specifier.cpp
    cfe/trunk/test/Index/recursive-cxx-member-calls.cpp
    cfe/trunk/test/SemaCXX/nested-name-spec-locations.cpp
    cfe/trunk/test/SemaTemplate/deduction-crash.cpp

Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Tue Mar  1 18:47:37 2011
@@ -1624,8 +1624,7 @@
 
   //===--------------------------------------------------------------------===//
   // 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 @@
 
   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();

Modified: cfe/trunk/include/clang/Sema/ParsedTemplate.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/ParsedTemplate.h?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/ParsedTemplate.h (original)
+++ cfe/trunk/include/clang/Sema/ParsedTemplate.h Tue Mar  1 18:47:37 2011
@@ -139,6 +139,9 @@
   /// 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 @@
     
     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 @@
       return TemplateId;
     }
     
-    void Destroy() { free(this); }
+    void Destroy() { 
+      SS.~CXXScopeSpec();
+      free(this); 
+    }
   };
 
   /// Retrieves the range of the given template parameter lists.

Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Tue Mar  1 18:47:37 2011
@@ -3182,17 +3182,27 @@
                                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<U>.
+  ///
+  /// \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,

Modified: cfe/trunk/lib/AST/TypeLoc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TypeLoc.cpp?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TypeLoc.cpp (original)
+++ cfe/trunk/lib/AST/TypeLoc.cpp Tue Mar  1 18:47:37 2011
@@ -102,6 +102,8 @@
     // FIXME: Currently QualifiedTypeLoc does not have a source range
     // case Qualified:
     case Elaborated:
+    case DependentName:
+    case DependentTemplateSpecialization:
       break;
     default:
       TypeLoc Next = Cur.getNextTypeLoc();

Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Tue Mar  1 18:47:37 2011
@@ -1013,7 +1013,7 @@
         ConsumeToken(); // The C++ scope.
         assert(Tok.is(tok::annot_template_id) &&
                "ParseOptionalCXXScopeSpecifier not working");
-        AnnotateTemplateIdTokenAsType(&SS);
+        AnnotateTemplateIdTokenAsType();
         continue;
       }
 

Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Tue Mar  1 18:47:37 2011
@@ -508,14 +508,14 @@
 ///         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<TemplateIdAnnotation *>(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 @@
     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 @@
                                 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 @@
   }
 
   // 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 @@
   DeclSpec DS;
   DS.SetRangeStart(IdLoc);
   DS.SetRangeEnd(EndLocation);
-  DS.getTypeSpecScope() = *SS;
+  DS.getTypeSpecScope() = SS;
 
   const char *PrevSpec = 0;
   unsigned DiagID;
@@ -739,7 +739,7 @@
       // 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 @@
     TemplateId = static_cast<TemplateIdAnnotation *>(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 @@
     } 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 @@
 
   // 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 @@
       = static_cast<TemplateIdAnnotation *>(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);
     }

Modified: cfe/trunk/lib/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExpr.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExpr.cpp Tue Mar  1 18:47:37 2011
@@ -904,7 +904,7 @@
         // cast expression.
         CXXScopeSpec SS;
         ParseOptionalCXXScopeSpecifier(SS, ParsedType(), false);
-        AnnotateTemplateIdTokenAsType(&SS);
+        AnnotateTemplateIdTokenAsType();
         return ParseCastExpression(isUnaryExpression, isAddressOfOperand,
                                    NotCastExpr, TypeOfCast);
       }

Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Tue Mar  1 18:47:37 2011
@@ -173,7 +173,7 @@
                                                                     ObjectType, 
                                                                 EnteringContext,
                                                                     Template)) {
-        if (AnnotateTemplateIdToken(Template, TNK, &SS, TemplateName, 
+        if (AnnotateTemplateIdToken(Template, TNK, SS, TemplateName, 
                                     TemplateKWLoc, false))
           return true;
       } else
@@ -312,7 +312,7 @@
         // 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 @@
                                                    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 @@
   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 @@
       TemplateId->TemplateNameLoc = Id.StartLocation;
     }
 
+    TemplateId->SS = SS;
     TemplateId->Template = Template;
     TemplateId->Kind = TNK;
     TemplateId->LAngleLoc = LAngleLoc;
@@ -1206,7 +1207,7 @@
   
   // Constructor and destructor names.
   TypeResult Type
-    = Actions.ActOnTemplateIdType(Template, NameLoc,
+    = Actions.ActOnTemplateIdType(SS, Template, NameLoc,
                                   LAngleLoc, TemplateArgsPtr,
                                   RAngleLoc);
   if (Type.isInvalid())

Modified: cfe/trunk/lib/Parse/ParseTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTemplate.cpp?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTemplate.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTemplate.cpp Tue Mar  1 18:47:37 2011
@@ -661,7 +661,7 @@
 bool
 Parser::ParseTemplateIdAfterTemplateName(TemplateTy Template,
                                          SourceLocation TemplateNameLoc,
-                                         const CXXScopeSpec *SS,
+                                         const CXXScopeSpec &SS,
                                          bool ConsumeLastToken,
                                          SourceLocation &LAngleLoc,
                                          TemplateArgList &TemplateArgs,
@@ -756,7 +756,7 @@
 /// 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 @@
   // 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 @@
 
     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 @@
       TemplateId->Name = 0;
       TemplateId->Operator = TemplateName.OperatorFunctionId.Operator;
     }
+    TemplateId->SS = SS;
     TemplateId->Template = Template;
     TemplateId->Kind = TNK;
     TemplateId->LAngleLoc = LAngleLoc;
@@ -854,7 +856,7 @@
 /// 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 @@
                                      TemplateId->NumArgs);
 
   TypeResult Type
-    = Actions.ActOnTemplateIdType(TemplateId->Template,
+    = Actions.ActOnTemplateIdType(TemplateId->SS,
+                                  TemplateId->Template,
                                   TemplateId->TemplateNameLoc,
                                   TemplateId->LAngleLoc,
                                   TemplateArgsPtr,
@@ -876,8 +879,8 @@
   // 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

Modified: cfe/trunk/lib/Parse/ParseTentative.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTentative.cpp?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTentative.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTentative.cpp Tue Mar  1 18:47:37 2011
@@ -907,7 +907,7 @@
     if (TemplateId->Kind != TNK_Type_template)
       return TPResult::False();
     CXXScopeSpec SS;
-    AnnotateTemplateIdTokenAsType(&SS);
+    AnnotateTemplateIdTokenAsType();
     assert(Tok.is(tok::annot_typename));
     goto case_typename;
   }

Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Tue Mar  1 18:47:37 2011
@@ -1129,7 +1129,7 @@
                                    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 @@
       // 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;
     }
   }

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Tue Mar  1 18:47:37 2011
@@ -3755,7 +3755,8 @@
     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 @@
       ASTTemplateArgsPtr TemplateArgsPtr(*this,
                                          TemplateId->getTemplateArgs(),
                                          TemplateId->NumArgs);
-      TypeResult T = ActOnTemplateIdType(TemplateId->Template,
+      TypeResult T = ActOnTemplateIdType(TemplateId->SS,
+                                         TemplateId->Template,
                                          TemplateId->TemplateNameLoc,
                                          TemplateId->LAngleLoc,
                                          TemplateArgsPtr,

Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp Tue Mar  1 18:47:37 2011
@@ -1743,10 +1743,14 @@
 }
 
 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<TemplateName>();
 
   // Translate the parser's template argument list in our AST format.
@@ -1763,14 +1767,10 @@
     TypeLocBuilder TLB;
     DependentTemplateSpecializationTypeLoc SpecTL
       = TLB.push<DependentTemplateSpecializationTypeLoc>(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 @@
   if (Result.isNull())
     return true;
 
-  TypeSourceInfo *DI = Context.CreateTypeSourceInfo(Result);
-  TemplateSpecializationTypeLoc TL
-    = cast<TemplateSpecializationTypeLoc>(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());
-
-  return CreateParsedType(Result, DI);
+  // Build type-source information.
+  TypeLocBuilder TLB;  
+  TemplateSpecializationTypeLoc SpecTL
+    = TLB.push<TemplateSpecializationTypeLoc>(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());
+
+  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<ElaboratedTypeLoc>(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<TemplateName>();
+  
+  // 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<RecordType>()) {
+  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<DependentTemplateSpecializationTypeLoc>(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<RecordType>()) {
     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);
     }
   }
+  
+  // Provide source-location information for the template specialization.
+  TypeLocBuilder TLB;
+  TemplateSpecializationTypeLoc SpecTL
+    = TLB.push<TemplateSpecializationTypeLoc>(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());
 
-  ElaboratedTypeKeyword Keyword
-    = TypeWithKeyword::getKeywordForTagTypeKind(TagKind);
-  QualType ElabType = Context.getElaboratedType(Keyword, SS.getScopeRep(), Type);
-
-  TypeSourceInfo *ElabDI = Context.CreateTypeSourceInfo(ElabType);
-  ElaboratedTypeLoc TL = cast<ElaboratedTypeLoc>(ElabDI->getTypeLoc());
-  TL.setKeywordLoc(TagLoc);
-  TL.setQualifierLoc(SS.getWithLocInContext(Context));
-  TL.getNamedTypeLoc().initializeFullCopy(DI->getTypeLoc());
-  return CreateParsedType(ElabType, ElabDI);
+  // Construct an elaborated type containing the nested-name-specifier (if any)
+  // and keyword.
+  Result = Context.getElaboratedType(Keyword, SS.getScopeRep(), Result);
+  ElaboratedTypeLoc ElabTL = TLB.push<ElaboratedTypeLoc>(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 @@
     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<DependentNameTypeLoc>(Result);
+  TL.setKeywordLoc(TagLoc);
+  TL.setQualifierLoc(SS.getWithLocInContext(Context));
+  TL.setNameLoc(NameLoc);
+  return CreateParsedType(Result, TLB.getTypeSourceInfo(Context, Result));
 }
 
 TypeResult

Modified: cfe/trunk/test/Index/annotate-nested-name-specifier.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/annotate-nested-name-specifier.cpp?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/test/Index/annotate-nested-name-specifier.cpp (original)
+++ cfe/trunk/test/Index/annotate-nested-name-specifier.cpp Tue Mar  1 18:47:37 2011
@@ -103,12 +103,14 @@
 
 template<typename T>
 struct X6 {
-  typedef T type;
+  typedef T* type;
   typedef typename outer_alias::inner::vector<type>::template rebind<type> type1;
   typedef typename outer_alias::inner::vector<type>::template rebind<type>::other type2;
+  typedef class outer_alias::inner::vector<type>::template rebind<type> type3;
+  typedef class outer_alias::inner::vector<type>::template rebind<type>::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 @@
 // 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 @@
 // 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 @@
 // 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)

Modified: cfe/trunk/test/Index/recursive-cxx-member-calls.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/recursive-cxx-member-calls.cpp?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/test/Index/recursive-cxx-member-calls.cpp (original)
+++ cfe/trunk/test/Index/recursive-cxx-member-calls.cpp Tue Mar  1 18:47:37 2011
@@ -679,8 +679,8 @@
 // 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 @@
 // 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 @@
 // 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 @@
 // 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]

Modified: cfe/trunk/test/SemaCXX/nested-name-spec-locations.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/nested-name-spec-locations.cpp?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/nested-name-spec-locations.cpp (original)
+++ cfe/trunk/test/SemaCXX/nested-name-spec-locations.cpp Tue Mar  1 18:47:37 2011
@@ -110,3 +110,21 @@
 };
 
 DependentTemplateSpecializationTypeTester2<HasApply, int> DTSTCheck2; // expected-note{{in instantiation of template class}}
+
+template<typename T, typename U>
+struct DependentTemplateSpecializationTypeTester3 :
+  T::template apply<typename add_reference<U>::type 
+                                     * // expected-error{{declared as a pointer to a reference of type}}
+                                     >
+{};
+
+DependentTemplateSpecializationTypeTester3<HasApply, int> DTSTCheck3; // expected-note{{in instantiation of template class}}
+
+template<typename T, typename U>
+struct DependentTemplateSpecializationTypeTester4 {
+  typedef class T::template apply<typename add_reference<U>::type 
+                                     * // expected-error{{declared as a pointer to a reference of type}}
+                                     > type;
+};
+
+DependentTemplateSpecializationTypeTester4<HasApply, int> DTSTCheck4; // expected-note{{in instantiation of template class}}

Modified: cfe/trunk/test/SemaTemplate/deduction-crash.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/deduction-crash.cpp?rev=126808&r1=126807&r2=126808&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/deduction-crash.cpp (original)
+++ cfe/trunk/test/SemaTemplate/deduction-crash.cpp Tue Mar  1 18:47:37 2011
@@ -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<a>
 struct int_;
 





More information about the cfe-commits mailing list