clang  6.0.0svn
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. More...
 
bool isInherited () const
 Determine whether the default argument for this parameter was inherited from a previous declaration of the same entity. More...
 
ArgType get () const
 Get the default argument's value. More...
 
const ParmDecl * getInheritedFrom () const
 Get the parameter from which we inherit the default argument, if any. More...
 
void set (ArgType Arg)
 Set the default argument. More...
 
void setInherited (const ASTContext &C, ParmDecl *InheritedFrom)
 Set that the default argument was inherited from another parameter. More...
 
void clear ()
 Remove the default argument, even if it was inherited. More...
 

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 287 of file DeclTemplate.h.

Constructor & Destructor Documentation

◆ DefaultArgStorage()

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

Definition at line 311 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 322 of file DeclTemplate.h.

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

◆ 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 333 of file DeclTemplate.h.

◆ 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 318 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

Set the default argument.

Definition at line 342 of file DeclTemplate.h.

Referenced by clang::TemplateTypeParmDecl::setDefaultArgument(), and clang::NonTypeTemplateParmDecl::setDefaultArgument().

◆ 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: