class DefaultArgStorage

Declaration

template <typename ParmDecl, typename ArgType>
class DefaultArgStorage { /* full declaration omitted */ };

Description

Storage for a default argument. This is conceptually either empty, or an argument value, or a pointer to a previous declaration that had a default argument. However, this is complicated by modules: while we require all the default arguments for a template to be equivalent, there may be more than one, and we need to track all the originating parameters to determine if the default argument is visible.

Declared at: clang/include/clang/AST/DeclTemplate.h:315

Templates

ParmDecl
ArgType

Member Variables

private llvm::PointerUnion<ArgType, ParmDecl*, Chain*> ValueOrInherited

Method Overview

Methods

DefaultArgStorage<ParmDecl, ArgType>()

Declared at: clang/include/clang/AST/DeclTemplate.h:339

void clear()

Description

Remove the default argument, even if it was inherited.

Declared at: clang/include/clang/AST/DeclTemplate.h:395

ArgType get() const

Description

Get the default argument's value. This does not consider whether the default argument is visible.

Declared at: clang/include/clang/AST/DeclTemplate.h:350

const ParmDecl* getInheritedFrom() const

Description

Get the parameter from which we inherit the default argument, if any. This is the parameter on which the default argument was actually written.

Declared at: clang/include/clang/AST/DeclTemplate.h:361

static ParmDecl* getParmOwningDefaultArg(
    ParmDecl* Parm)

Declared at: clang/include/clang/AST/DeclTemplate.h:328

Parameters

ParmDecl* Parm

bool isInherited() const

Description

Determine whether the default argument for this parameter was inherited from a previous declaration of the same entity.

Declared at: clang/include/clang/AST/DeclTemplate.h:346

bool isSet() const

Description

Determine whether there is a default argument for this parameter.

Declared at: clang/include/clang/AST/DeclTemplate.h:342

void set(ArgType Arg)

Description

Set the default argument.

Declared at: clang/include/clang/AST/DeclTemplate.h:370

Parameters

ArgType Arg

void setInherited(const clang::ASTContext& C,
                  ParmDecl* InheritedFrom)

Description

Set that the default argument was inherited from another parameter.

Declared at: clang/include/clang/AST/DeclTemplate.h:376

Parameters

const clang::ASTContext& C
ParmDecl* InheritedFrom