clang 18.0.0git
Public Member Functions | Static Public Member Functions | List of all members
clang::ExplicitSpecifier Class Reference

Store information needed for an explicit specifier. More...

#include "clang/AST/DeclCXX.h"

Public Member Functions

 ExplicitSpecifier ()=default
 
 ExplicitSpecifier (Expr *Expression, ExplicitSpecKind Kind)
 
ExplicitSpecKind getKind () const
 
const ExprgetExpr () const
 
ExprgetExpr ()
 
bool isSpecified () const
 Determine if the declaration had an explicit specifier of any kind.
 
bool isEquivalent (const ExplicitSpecifier Other) const
 Check for equivalence of explicit specifiers.
 
bool isExplicit () const
 Determine whether this specifier is known to correspond to an explicit declaration.
 
bool isInvalid () const
 Determine if the explicit specifier is invalid.
 
void setKind (ExplicitSpecKind Kind)
 
void setExpr (Expr *E)
 

Static Public Member Functions

static ExplicitSpecifier getFromDecl (FunctionDecl *Function)
 
static const ExplicitSpecifier getFromDecl (const FunctionDecl *Function)
 
static ExplicitSpecifier Invalid ()
 

Detailed Description

Store information needed for an explicit specifier.

Used by CXXDeductionGuideDecl, CXXConstructorDecl and CXXConversionDecl.

Definition at line 1882 of file DeclCXX.h.

Constructor & Destructor Documentation

◆ ExplicitSpecifier() [1/2]

clang::ExplicitSpecifier::ExplicitSpecifier ( )
default

Referenced by Invalid().

◆ ExplicitSpecifier() [2/2]

clang::ExplicitSpecifier::ExplicitSpecifier ( Expr Expression,
ExplicitSpecKind  Kind 
)
inline

Definition at line 1888 of file DeclCXX.h.

Member Function Documentation

◆ getExpr() [1/2]

Expr * clang::ExplicitSpecifier::getExpr ( )
inline

Definition at line 1892 of file DeclCXX.h.

◆ getExpr() [2/2]

const Expr * clang::ExplicitSpecifier::getExpr ( ) const
inline

◆ getFromDecl() [1/2]

static const ExplicitSpecifier clang::ExplicitSpecifier::getFromDecl ( const FunctionDecl Function)
inlinestatic

Definition at line 1919 of file DeclCXX.h.

References getFromDecl().

◆ getFromDecl() [2/2]

ExplicitSpecifier ExplicitSpecifier::getFromDecl ( FunctionDecl Function)
static

◆ getKind()

ExplicitSpecKind clang::ExplicitSpecifier::getKind ( ) const
inline

Definition at line 1890 of file DeclCXX.h.

Referenced by addExplicitSpecifier(), instantiateExplicitSpecifier(), and isEquivalent().

◆ Invalid()

static ExplicitSpecifier clang::ExplicitSpecifier::Invalid ( )
inlinestatic

Definition at line 1922 of file DeclCXX.h.

References ExplicitSpecifier(), and clang::Unresolved.

Referenced by instantiateExplicitSpecifier().

◆ isEquivalent()

bool ExplicitSpecifier::isEquivalent ( const ExplicitSpecifier  Other) const

Check for equivalence of explicit specifiers.

Returns
true if the explicit specifier are equivalent, false otherwise.

Definition at line 2087 of file DeclCXX.cpp.

References clang::ODRHash::AddStmt(), clang::ODRHash::CalculateHash(), getExpr(), getKind(), and clang::Unresolved.

◆ isExplicit()

bool clang::ExplicitSpecifier::isExplicit ( ) const
inline

Determine whether this specifier is known to correspond to an explicit declaration.

Returns false if the specifier is absent or has an expression that is value-dependent or evaluates to false.

Definition at line 1906 of file DeclCXX.h.

References clang::ResolvedTrue.

Referenced by DiagnoseFailedExplicitSpec(), clang::CXXDeductionGuideDecl::isExplicit(), clang::CXXConstructorDecl::isExplicit(), clang::CXXConversionDecl::isExplicit(), isNonDependentlyExplicit(), and clang::CXXConstructorDecl::setExplicitSpecifier().

◆ isInvalid()

bool clang::ExplicitSpecifier::isInvalid ( ) const
inline

Determine if the explicit specifier is invalid.

This state occurs after a substitution failures.

Definition at line 1911 of file DeclCXX.h.

References clang::Unresolved.

Referenced by clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().

◆ isSpecified()

bool clang::ExplicitSpecifier::isSpecified ( ) const
inline

Determine if the declaration had an explicit specifier of any kind.

Definition at line 1895 of file DeclCXX.h.

References clang::ResolvedFalse.

Referenced by clang::DeclSpec::hasExplicitSpecifier().

◆ setExpr()

void clang::ExplicitSpecifier::setExpr ( Expr E)
inline

Definition at line 1916 of file DeclCXX.h.

Referenced by clang::Sema::tryResolveExplicitSpecifier().

◆ setKind()

void clang::ExplicitSpecifier::setKind ( ExplicitSpecKind  Kind)
inline

Definition at line 1915 of file DeclCXX.h.

Referenced by clang::Sema::tryResolveExplicitSpecifier().


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