clang 17.0.0git
|
Storage for a default argument. More...
#include "clang/AST/DeclTemplate.h"
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. | |
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 313 of file DeclTemplate.h.
|
inline |
Definition at line 337 of file DeclTemplate.h.
|
inline |
Remove the default argument, even if it was inherited.
Definition at line 393 of file DeclTemplate.h.
Referenced by clang::TemplateTypeParmDecl::removeDefaultArgument(), clang::NonTypeTemplateParmDecl::removeDefaultArgument(), and clang::TemplateTemplateParmDecl::removeDefaultArgument().
|
inline |
Get the default argument's value.
This does not consider whether the default argument is visible.
Definition at line 348 of file DeclTemplate.h.
References clang::C.
Referenced by clang::TemplateTypeParmDecl::getDefaultArgument(), clang::NonTypeTemplateParmDecl::getDefaultArgument(), clang::TemplateTemplateParmDecl::getDefaultArgument(), clang::TemplateTypeParmDecl::getDefaultArgumentInfo(), and clang::DefaultArgStorage< ParmDecl, ArgType >::setInherited().
|
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 359 of file DeclTemplate.h.
References clang::C.
Referenced by clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitNonTypeTemplateParmDecl(), clang::JSONNodeDumper::VisitNonTypeTemplateParmDecl(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitTemplateTemplateParmDecl(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitTemplateTypeParmDecl(), and clang::JSONNodeDumper::VisitTemplateTypeParmDecl().
|
inline |
Determine whether the default argument for this parameter was inherited from a previous declaration of the same entity.
Definition at line 344 of file DeclTemplate.h.
Referenced by clang::TemplateTypeParmDecl::defaultArgumentWasInherited(), clang::NonTypeTemplateParmDecl::defaultArgumentWasInherited(), and clang::TemplateTemplateParmDecl::defaultArgumentWasInherited().
|
inline |
Determine whether there is a default argument for this parameter.
Definition at line 340 of file DeclTemplate.h.
Referenced by clang::TemplateTemplateParmDecl::getDefaultArgument(), clang::TemplateTypeParmDecl::hasDefaultArgument(), clang::NonTypeTemplateParmDecl::hasDefaultArgument(), clang::TemplateTemplateParmDecl::hasDefaultArgument(), clang::DefaultArgStorage< ParmDecl, ArgType >::set(), and clang::DefaultArgStorage< ParmDecl, ArgType >::setInherited().
|
inline |
Set the default argument.
Definition at line 368 of file DeclTemplate.h.
References clang::DefaultArgStorage< ParmDecl, ArgType >::isSet().
Referenced by clang::TemplateTemplateParmDecl::setDefaultArgument(), clang::NonTypeTemplateParmDecl::setDefaultArgument(), and clang::TemplateTypeParmDecl::setDefaultArgument().
|
inline |
Set that the default argument was inherited from another parameter.
Definition at line 374 of file DeclTemplate.h.
References clang::allocateDefaultArgStorageChain(), clang::C, clang::DefaultArgStorage< ParmDecl, ArgType >::get(), and clang::DefaultArgStorage< ParmDecl, ArgType >::isSet().
Referenced by clang::NonTypeTemplateParmDecl::setInheritedDefaultArgument(), clang::TemplateTemplateParmDecl::setInheritedDefaultArgument(), and clang::TemplateTypeParmDecl::setInheritedDefaultArgument().