clang API Documentation

Public Member Functions | Static Public Member Functions
clang::CXXOperatorCallExpr Class Reference

A call to an overloaded operator written using operator syntax. More...

#include <ExprCXX.h>

Inheritance diagram for clang::CXXOperatorCallExpr:
Inheritance graph
[legend]
Collaboration diagram for clang::CXXOperatorCallExpr:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CXXOperatorCallExpr (ASTContext &C, OverloadedOperatorKind Op, Expr *fn, Expr **args, unsigned numargs, QualType t, ExprValueKind VK, SourceLocation operatorloc)
 CXXOperatorCallExpr (ASTContext &C, EmptyShell Empty)
OverloadedOperatorKind getOperator () const
void setOperator (OverloadedOperatorKind Kind)
SourceLocation getOperatorLoc () const
SourceRange getSourceRange () const

Static Public Member Functions

static bool classof (const Stmt *T)
static bool classof (const CXXOperatorCallExpr *)

Detailed Description

A call to an overloaded operator written using operator syntax.

Represents a call to an overloaded operator written using operator syntax, e.g., "x + y" or "*p". While semantically equivalent to a normal call, this AST node provides better information about the syntactic representation of the call.

In a C++ template, this expression node kind will be used whenever any of the arguments are type-dependent. In this case, the function itself will be a (possibly empty) set of functions and function templates that were found by name lookup at template definition time.

Definition at line 49 of file ExprCXX.h.


Constructor & Destructor Documentation

clang::CXXOperatorCallExpr::CXXOperatorCallExpr ( ASTContext C,
OverloadedOperatorKind  Op,
Expr fn,
Expr **  args,
unsigned  numargs,
QualType  t,
ExprValueKind  VK,
SourceLocation  operatorloc 
) [inline]

Definition at line 54 of file ExprCXX.h.

clang::CXXOperatorCallExpr::CXXOperatorCallExpr ( ASTContext C,
EmptyShell  Empty 
) [inline, explicit]

Definition at line 60 of file ExprCXX.h.


Member Function Documentation

static bool clang::CXXOperatorCallExpr::classof ( const Stmt T) [inline, static]

Reimplemented from clang::CallExpr.

Definition at line 78 of file ExprCXX.h.

References clang::Stmt::getStmtClass().

static bool clang::CXXOperatorCallExpr::classof ( const CXXOperatorCallExpr ) [inline, static]

Definition at line 81 of file ExprCXX.h.

OverloadedOperatorKind clang::CXXOperatorCallExpr::getOperator ( ) const [inline]

getOperator - Returns the kind of overloaded operator that this expression refers to.

Definition at line 66 of file ExprCXX.h.

Referenced by DecodeOperatorCall(), getSourceRange(), and clang::Expr::isUnusedResultAWarning().

SourceLocation clang::CXXOperatorCallExpr::getOperatorLoc ( ) const [inline]

getOperatorLoc - Returns the location of the operator symbol in the expression. When getOperator()==OO_Call, this is the location of the right parentheses; when getOperator()==OO_Subscript, this is the location of the right bracket.

Definition at line 74 of file ExprCXX.h.

References clang::CallExpr::getRParenLoc().

Referenced by getSourceRange(), and clang::Expr::isUnusedResultAWarning().

SourceRange CXXOperatorCallExpr::getSourceRange ( ) const

SourceLocation tokens are not useful in isolation - they are low level value objects created/interpreted by SourceManager. We assume AST clients will have a pointer to the respective SourceManager.

Reimplemented from clang::CallExpr.

Definition at line 411 of file ExprCXX.cpp.

References clang::CallExpr::getArg(), clang::CallExpr::getNumArgs(), getOperator(), getOperatorLoc(), clang::CallExpr::getRParenLoc(), and clang::Stmt::getSourceRange().

Referenced by clang::Expr::isUnusedResultAWarning().

void clang::CXXOperatorCallExpr::setOperator ( OverloadedOperatorKind  Kind) [inline]

Definition at line 67 of file ExprCXX.h.


The documentation for this class was generated from the following files: