From 0265555a0fec81102bfb3757cfc7f3d90dbbe409 Mon Sep 17 00:00:00 2001 From: Abramo Bagnara Date: Mon, 7 May 2012 09:06:16 +0000 Subject: [PATCH] Fixed UserDefinedLiteral source locations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156298 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/ExprCXX.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h index 221e4de790..5bc269891f 100644 --- a/include/clang/AST/ExprCXX.h +++ b/include/clang/AST/ExprCXX.h @@ -375,10 +375,21 @@ public: return const_cast(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; -- 2.40.0