clang API Documentation
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit.ext]). More...
#include <ExprCXX.h>
Public Types | |
enum | LiteralOperatorKind { LOK_Raw, LOK_Template, LOK_Integer, LOK_Floating, LOK_String, LOK_Character } |
The kind of literal operator which is invoked. More... | |
Public Member Functions | |
UserDefinedLiteral (const ASTContext &C, Expr *Fn, ArrayRef< Expr * > Args, QualType T, ExprValueKind VK, SourceLocation LitEndLoc, SourceLocation SuffixLoc) | |
UserDefinedLiteral (const ASTContext &C, EmptyShell Empty) | |
LiteralOperatorKind | getLiteralOperatorKind () const |
Returns the kind of literal operator invocation which this expression represents. | |
Expr * | getCookedLiteral () |
If this is not a raw user-defined literal, get the underlying cooked literal (representing the literal with the suffix removed). | |
const Expr * | getCookedLiteral () const |
SourceLocation | getLocStart () const |
SourceLocation | getLocEnd () const |
SourceLocation | getUDSuffixLoc () const |
Returns the location of a ud-suffix in the expression. | |
const IdentifierInfo * | getUDSuffix () const |
Returns the ud-suffix specified for this literal. | |
Static Public Member Functions | |
static bool | classof (const Stmt *S) |
Friends | |
class | ASTStmtReader |
class | ASTStmtWriter |
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit.ext]).
Represents a user-defined literal, e.g. "foo"_bar or 1.23_xyz. While this is semantically equivalent to a normal call, this AST node provides better information about the syntactic representation of the literal.
Since literal operators are never found by ADL and can only be declared at namespace scope, a user-defined literal is never dependent.
The kind of literal operator which is invoked.
clang::UserDefinedLiteral::UserDefinedLiteral | ( | const ASTContext & | C, |
Expr * | Fn, | ||
ArrayRef< Expr * > | Args, | ||
QualType | T, | ||
ExprValueKind | VK, | ||
SourceLocation | LitEndLoc, | ||
SourceLocation | SuffixLoc | ||
) | [inline] |
clang::UserDefinedLiteral::UserDefinedLiteral | ( | const ASTContext & | C, |
EmptyShell | Empty | ||
) | [inline, explicit] |
static bool clang::UserDefinedLiteral::classof | ( | const Stmt * | S | ) | [inline, static] |
Reimplemented from clang::CallExpr.
Definition at line 417 of file ExprCXX.h.
References clang::Stmt::getStmtClass().
If this is not a raw user-defined literal, get the underlying cooked literal (representing the literal with the suffix removed).
Definition at line 756 of file ExprCXX.cpp.
References clang::CallExpr::getArg(), getLiteralOperatorKind(), LOK_Raw, and LOK_Template.
Referenced by getCookedLiteral().
const Expr* clang::UserDefinedLiteral::getCookedLiteral | ( | ) | const [inline] |
Definition at line 396 of file ExprCXX.h.
References getCookedLiteral().
Returns the kind of literal operator invocation which this expression represents.
Definition at line 735 of file ExprCXX.cpp.
References clang::CallExpr::getCalleeDecl(), clang::CallExpr::getNumArgs(), clang::Type::isAnyCharacterType(), clang::Type::isFloatingType(), clang::Type::isIntegerType(), clang::Type::isPointerType(), LOK_Character, LOK_Floating, LOK_Integer, LOK_Raw, LOK_String, and LOK_Template.
Referenced by getCookedLiteral(), and getLocStart().
SourceLocation clang::UserDefinedLiteral::getLocEnd | ( | ) | const [inline] |
Reimplemented from clang::CallExpr.
Definition at line 405 of file ExprCXX.h.
References clang::CallExpr::getRParenLoc().
SourceLocation clang::UserDefinedLiteral::getLocStart | ( | ) | const [inline] |
Reimplemented from clang::CallExpr.
Definition at line 400 of file ExprCXX.h.
References clang::CallExpr::getArg(), getLiteralOperatorKind(), clang::Stmt::getLocStart(), clang::CallExpr::getRParenLoc(), and LOK_Template.
const IdentifierInfo * UserDefinedLiteral::getUDSuffix | ( | ) | const |
Returns the ud-suffix specified for this literal.
Definition at line 764 of file ExprCXX.cpp.
References clang::CallExpr::getCalleeDecl().
SourceLocation clang::UserDefinedLiteral::getUDSuffixLoc | ( | ) | const [inline] |
friend class ASTStmtReader [friend] |
Reimplemented from clang::Stmt.
friend class ASTStmtWriter [friend] |
Reimplemented from clang::Stmt.