clang 20.0.0git
Classes | Public Member Functions | List of all members
clang::DefaultArgStorage< ParmDecl, ArgType > Class Template Reference

Storage for a default argument. More...

#include "clang/AST/DeclTemplate.h"

Inheritance diagram for clang::DefaultArgStorage< ParmDecl, ArgType >:
Inheritance graph
[legend]

Public Member Functions

 DefaultArgStorage ()
 
bool isSet () const
 Determine whether there is a default argument for this parameter.
 
bool isInherited () const
 Determine whether the default argument for this parameter was inherited from a previous declaration of the same entity.
 
ArgType get () const
 Get the default argument's value.
 
const ParmDecl * getInheritedFrom () const
 Get the parameter from which we inherit the default argument, if any.
 
void set (ArgType Arg)
 Set the default argument.
 
void setInherited (const ASTContext &C, ParmDecl *InheritedFrom)
 Set that the default argument was inherited from another parameter.
 
void clear ()
 Remove the default argument, even if it was inherited.
 

Detailed Description

template<typename ParmDecl, typename ArgType>
class clang::DefaultArgStorage< ParmDecl, ArgType >

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.

Definition at line 299 of file DeclTemplate.h.

Constructor & Destructor Documentation

◆ DefaultArgStorage()

template<typename ParmDecl , typename ArgType >
clang::DefaultArgStorage< ParmDecl, ArgType >::DefaultArgStorage ( )
inline

Definition at line 323 of file DeclTemplate.h.

Member Function Documentation

◆ clear()

template<typename ParmDecl , typename ArgType >
void clang::DefaultArgStorage< ParmDecl, ArgType >::clear ( )
inline

◆ get()

template<typename ParmDecl , typename ArgType >
ArgType clang::DefaultArgStorage< ParmDecl, ArgType >::get ( ) const
inline

Get the default argument's value.

This does not consider whether the default argument is visible.

Definition at line 334 of file DeclTemplate.h.

References clang::C.

Referenced by clang::TemplateTypeParmDecl::getDefaultArgument(), clang::NonTypeTemplateParmDecl::getDefaultArgument(), clang::TemplateTemplateParmDecl::getDefaultArgument(), and clang::DefaultArgStorage< ParmDecl, ArgType >::setInherited().

◆ getInheritedFrom()

template<typename ParmDecl , typename ArgType >
const ParmDecl * clang::DefaultArgStorage< ParmDecl, ArgType >::getInheritedFrom ( ) const
inline

Get the parameter from which we inherit the default argument, if any.

This is the parameter on which the default argument was actually written.

Definition at line 345 of file DeclTemplate.h.

References clang::C, and D.

◆ isInherited()

template<typename ParmDecl , typename ArgType >
bool clang::DefaultArgStorage< ParmDecl, ArgType >::isInherited ( ) const
inline

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

Definition at line 330 of file DeclTemplate.h.

Referenced by clang::TemplateTypeParmDecl::defaultArgumentWasInherited(), clang::NonTypeTemplateParmDecl::defaultArgumentWasInherited(), and clang::TemplateTemplateParmDecl::defaultArgumentWasInherited().

◆ isSet()

template<typename ParmDecl , typename ArgType >
bool clang::DefaultArgStorage< ParmDecl, ArgType >::isSet ( ) const
inline

◆ set()

template<typename ParmDecl , typename ArgType >
void clang::DefaultArgStorage< ParmDecl, ArgType >::set ( ArgType  Arg)
inline

◆ setInherited()

template<typename ParmDecl , typename ArgType >
void clang::DefaultArgStorage< ParmDecl, ArgType >::setInherited ( const ASTContext C,
ParmDecl *  InheritedFrom 
)
inline

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