]> granicus.if.org Git - clang/commitdiff
Fixed UserDefinedLiteral source locations.
authorAbramo Bagnara <abramo.bagnara@gmail.com>
Mon, 7 May 2012 09:06:16 +0000 (09:06 +0000)
committerAbramo Bagnara <abramo.bagnara@gmail.com>
Mon, 7 May 2012 09:06:16 +0000 (09:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156298 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/ExprCXX.h

index 221e4de790e5ddfddf6bc7532aa1c69cb149f121..5bc269891f37b9a7bf5edf7443cf573ecfcad10b 100644 (file)
@@ -375,10 +375,21 @@ public:
     return const_cast<UserDefinedLiteral*>(this)->getCookedLiteral();
   }
 
+  SourceLocation getLocStart() const {
+    if (getLiteralOperatorKind() == LOK_Template)
+      return getRParenLoc();
+    return getArg(0)->getLocStart();
+  }
+  SourceLocation getLocEnd() const { return getRParenLoc(); }
+  SourceRange getSourceRange() const {
+    return SourceRange(getLocStart(), getLocEnd());
+  }
+
+
   /// getUDSuffixLoc - Returns the location of a ud-suffix in the expression.
   /// For a string literal, there may be multiple identical suffixes. This
   /// returns the first.
-  SourceLocation getUDSuffixLoc() const { return getRParenLoc(); }
+  SourceLocation getUDSuffixLoc() const { return UDSuffixLoc; }
 
   /// getUDSuffix - Returns the ud-suffix specified for this literal.
   const IdentifierInfo *getUDSuffix() const;