Keep track of the location of the '~' in a pseudo-destructor expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97080 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 689ad49..abc775e 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -2187,6 +2187,7 @@
                                              const CXXScopeSpec &SS,
                                              TypeSourceInfo *ScopeType,
                                              SourceLocation CCLoc,
+                                             SourceLocation TildeLoc,
                                              TypeSourceInfo *DestroyedType,
                                              bool HasTrailingLParen);
   
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 3fb587f..71aae73 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -2940,6 +2940,7 @@
                                (NestedNameSpecifier *) SS.getScopeRep(),
                                                        SS.getRange(),
                                                        0, SourceLocation(),
+                                                       MemberLoc,
                                                        DestroyedTypeInfo));
   }
 
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 98e8000..4fca322 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -2433,6 +2433,7 @@
                                                        const CXXScopeSpec &SS,
                                                  TypeSourceInfo *ScopeTypeInfo,
                                                        SourceLocation CCLoc,
+                                                       SourceLocation TildeLoc,
                                              TypeSourceInfo *DestructedTypeInfo,
                                                        bool HasTrailingLParen) {
   assert(DestructedTypeInfo && "No destructed type in pseudo-destructor expr?");
@@ -2513,6 +2514,7 @@
                                                   SS.getRange(),
                                                   ScopeTypeInfo,
                                                   CCLoc,
+                                                  TildeLoc,
                                                   DestructedTypeInfo));
   if (HasTrailingLParen)
     return move(Result);
@@ -2789,8 +2791,8 @@
 
     
   return BuildPseudoDestructorExpr(move(Base), OpLoc, OpKind, SS,
-                                   ScopeTypeInfo, CCLoc, DestructedTypeInfo,
-                                   HasTrailingLParen);
+                                   ScopeTypeInfo, CCLoc, TildeLoc,
+                                   DestructedTypeInfo, HasTrailingLParen);
 }
 
 CXXMemberCallExpr *Sema::BuildCXXMemberCallExpr(Expr *Exp, 
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h
index bd939f0..922c041 100644
--- a/lib/Sema/TreeTransform.h
+++ b/lib/Sema/TreeTransform.h
@@ -888,6 +888,7 @@
                                                   SourceRange QualifierRange,
                                                   TypeSourceInfo *ScopeType,
                                                   SourceLocation CCLoc,
+                                                  SourceLocation TildeLoc,
                                                 TypeSourceInfo *DestroyedType);
 
   /// \brief Build a new unary operator expression.
@@ -4705,6 +4706,7 @@
                                                      E->getQualifierRange(),
                                                      ScopeTypeInfo,
                                                      E->getColonColonLoc(),
+                                                     E->getTildeLoc(),
                                                      DestroyedTypeInfo);
 }
 
@@ -5755,6 +5757,7 @@
                                                      SourceRange QualifierRange,
                                                      TypeSourceInfo *ScopeType,
                                                        SourceLocation CCLoc,
+                                                       SourceLocation TildeLoc,
                                                TypeSourceInfo *DestroyedType) {
   CXXScopeSpec SS;
   if (Qualifier) {
@@ -5771,7 +5774,7 @@
     // This pseudo-destructor expression is still a pseudo-destructor.
     return SemaRef.BuildPseudoDestructorExpr(move(Base), OperatorLoc,
                                              isArrow? tok::arrow : tok::period,
-                                             SS, ScopeType, CCLoc,
+                                             SS, ScopeType, CCLoc, TildeLoc,
                                              DestroyedType, 
                                              /*FIXME?*/true);
   }