class UserDefinedLiteral

Declaration

class UserDefinedLiteral : public CallExpr { /* full declaration omitted */ };

Description

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.

Declared at: clang/include/clang/AST/ExprCXX.h:638

Inherits from: CallExpr

Member Variables

private clang::SourceLocation UDSuffixLoc
The location of a ud-suffix within the literal.

Inherited from CallExpr:

public static NotADL = ADLCallKind::NotADL
public static UsesADL = ADLCallKind::UsesADL

Inherited from Stmt:

protected

Method Overview

  • public static clang::UserDefinedLiteral * Create(const clang::ASTContext & Ctx, clang::Expr * Fn, ArrayRef<clang::Expr *> Args, clang::QualType Ty, clang::ExprValueKind VK, clang::SourceLocation LitEndLoc, clang::SourceLocation SuffixLoc, clang::FPOptionsOverride FPFeatures)
  • public static clang::UserDefinedLiteral * CreateEmpty(const clang::ASTContext & Ctx, unsigned int NumArgs, bool HasFPOptions, clang::Stmt::EmptyShell Empty)
  • private UserDefinedLiteral(clang::Expr * Fn, ArrayRef<clang::Expr *> Args, clang::QualType Ty, clang::ExprValueKind VK, clang::SourceLocation LitEndLoc, clang::SourceLocation SuffixLoc, clang::FPOptionsOverride FPFeatures)
  • private UserDefinedLiteral(unsigned int NumArgs, bool HasFPFeatures, clang::Stmt::EmptyShell Empty)
  • public static bool classof(const clang::Stmt * S)
  • public clang::SourceLocation getBeginLoc() const
  • public clang::Expr * getCookedLiteral()
  • public const clang::Expr * getCookedLiteral() const
  • public clang::SourceLocation getEndLoc() const
  • public clang::UserDefinedLiteral::LiteralOperatorKind getLiteralOperatorKind() const
  • public const clang::IdentifierInfo * getUDSuffix() const
  • public clang::SourceLocation getUDSuffixLoc() const

Inherited from CallExpr:

Inherited from Expr:

Inherited from ValueStmt:

Inherited from Stmt:

Methods

static clang::UserDefinedLiteral* Create(
    const clang::ASTContext& Ctx,
    clang::Expr* Fn,
    ArrayRef<clang::Expr*> Args,
    clang::QualType Ty,
    clang::ExprValueKind VK,
    clang::SourceLocation LitEndLoc,
    clang::SourceLocation SuffixLoc,
    clang::FPOptionsOverride FPFeatures)

Declared at: clang/include/clang/AST/ExprCXX.h:655

Parameters

const clang::ASTContext& Ctx
clang::Expr* Fn
ArrayRef<clang::Expr*> Args
clang::QualType Ty
clang::ExprValueKind VK
clang::SourceLocation LitEndLoc
clang::SourceLocation SuffixLoc
clang::FPOptionsOverride FPFeatures

static clang::UserDefinedLiteral* CreateEmpty(
    const clang::ASTContext& Ctx,
    unsigned int NumArgs,
    bool HasFPOptions,
    clang::Stmt::EmptyShell Empty)

Declared at: clang/include/clang/AST/ExprCXX.h:661

Parameters

const clang::ASTContext& Ctx
unsigned int NumArgs
bool HasFPOptions
clang::Stmt::EmptyShell Empty

UserDefinedLiteral(
    clang::Expr* Fn,
    ArrayRef<clang::Expr*> Args,
    clang::QualType Ty,
    clang::ExprValueKind VK,
    clang::SourceLocation LitEndLoc,
    clang::SourceLocation SuffixLoc,
    clang::FPOptionsOverride FPFeatures)

Declared at: clang/include/clang/AST/ExprCXX.h:648

Parameters

clang::Expr* Fn
ArrayRef<clang::Expr*> Args
clang::QualType Ty
clang::ExprValueKind VK
clang::SourceLocation LitEndLoc
clang::SourceLocation SuffixLoc
clang::FPOptionsOverride FPFeatures

UserDefinedLiteral(unsigned int NumArgs,
                   bool HasFPFeatures,
                   clang::Stmt::EmptyShell Empty)

Declared at: clang/include/clang/AST/ExprCXX.h:652

Parameters

unsigned int NumArgs
bool HasFPFeatures
clang::Stmt::EmptyShell Empty

static bool classof(const clang::Stmt* S)

Declared at: clang/include/clang/AST/ExprCXX.h:715

Parameters

const clang::Stmt* S

clang::SourceLocation getBeginLoc() const

Declared at: clang/include/clang/AST/ExprCXX.h:698

clang::Expr* getCookedLiteral()

Description

If this is not a raw user-defined literal, get the underlying cooked literal (representing the literal with the suffix removed).

Declared at: clang/include/clang/AST/ExprCXX.h:693

const clang::Expr* getCookedLiteral() const

Declared at: clang/include/clang/AST/ExprCXX.h:694

clang::SourceLocation getEndLoc() const

Declared at: clang/include/clang/AST/ExprCXX.h:704

clang::UserDefinedLiteral::LiteralOperatorKind
getLiteralOperatorKind() const

Description

Returns the kind of literal operator invocation which this expression represents.

Declared at: clang/include/clang/AST/ExprCXX.h:688

const clang::IdentifierInfo* getUDSuffix() const

Description

Returns the ud-suffix specified for this literal.

Declared at: clang/include/clang/AST/ExprCXX.h:713

clang::SourceLocation getUDSuffixLoc() const

Description

Returns the location of a ud-suffix in the expression. For a string literal, there may be multiple identical suffixes. This returns the first.

Declared at: clang/include/clang/AST/ExprCXX.h:710