diff options
-rw-r--r-- | include/clang/AST/ExprCXX.h | 13 |
1 files changed, 12 insertions, 1 deletions
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<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; |