class CoreturnStmt

Declaration

class CoreturnStmt : public Stmt { /* full declaration omitted */ };

Description

Represents a 'co_return' statement in the C++ Coroutines TS. This statament models the initialization of the coroutine promise (encapsulating the eventual notional return value) from an expression (or braced-init-list), followed by termination of the coroutine. This initialization is modeled by the evaluation of the operand followed by a call to one of: <promise >.return_value( <operand >) <promise >.return_void() which we name the "promise call".

Declared at: clang/include/clang/AST/StmtCXX.h:458

Inherits from: Stmt

Member Variables

private clang::SourceLocation CoreturnLoc
private clang::Stmt* [2] SubStmts
private bool IsImplicit

Inherited from Stmt:

protected

Method Overview

Inherited from Stmt:

Methods

CoreturnStmt(clang::SourceLocation CoreturnLoc,
             clang::Stmt* Operand,
             clang::Stmt* PromiseCall,
             bool IsImplicit = false)

Declared at: clang/include/clang/AST/StmtCXX.h:468

Parameters

clang::SourceLocation CoreturnLoc
clang::Stmt* Operand
clang::Stmt* PromiseCall
bool IsImplicit = false

CoreturnStmt(clang::Stmt::EmptyShell)

Declared at: clang/include/clang/AST/StmtCXX.h:476

Parameters

clang::Stmt::EmptyShell

clang::Stmt::child_range children()

Declared at: clang/include/clang/AST/StmtCXX.h:499

clang::Stmt::const_child_range children() const

Declared at: clang/include/clang/AST/StmtCXX.h:503

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

Declared at: clang/include/clang/AST/StmtCXX.h:507

Parameters

const clang::Stmt* T

clang::SourceLocation getBeginLoc() const

Declared at: clang/include/clang/AST/StmtCXX.h:494

clang::SourceLocation getEndLoc() const

Declared at: clang/include/clang/AST/StmtCXX.h:495

clang::SourceLocation getKeywordLoc() const

Declared at: clang/include/clang/AST/StmtCXX.h:478

clang::Expr* getOperand() const

Description

Retrieve the operand of the 'co_return' statement. Will be nullptr if none was specified.

Declared at: clang/include/clang/AST/StmtCXX.h:482

clang::Expr* getPromiseCall() const

Description

Retrieve the promise call that results from this 'co_return' statement. Will be nullptr if either the coroutine has not yet been finalized or the coroutine has no eventual return type.

Declared at: clang/include/clang/AST/StmtCXX.h:487

bool isImplicit() const

Declared at: clang/include/clang/AST/StmtCXX.h:491

void setIsImplicit(bool value = true)

Declared at: clang/include/clang/AST/StmtCXX.h:492

Parameters

bool value = true