class FunctionProtoType

Declaration

class FunctionProtoType : public FunctionType,
                          public Node,
                          private TrailingObjects { /* full declaration omitted */ };

Description

Represents a prototype with parameter type info, e.g. 'int foo(int)' or 'int foo(void)'. 'void' is represented as having no parameters, not as having a single void parameter. Such a type can have an exception specification, but this specification is not part of the canonical type. FunctionProtoType has several trailing objects, some of which optional. For more information about the trailing objects see the first comment inside FunctionProtoType.

Declared at: clang/include/clang/AST/Type.h:3956

Inherits from: FunctionType, FoldingSetBase::Node, TrailingObjects

Member Variables

Inherited from Type:

protected

Method Overview

Inherited from FoldingSetBase::Node:

Inherited from FunctionType:

Inherited from Type:

Inherited from ExtQualsTypeCommonBase:

    Methods

    FunctionProtoType(
        clang::QualType result,
        ArrayRef<clang::QualType> params,
        clang::QualType canonical,
        const clang::FunctionProtoType::ExtProtoInfo&
            epi)

    Declared at: clang/include/clang/AST/Type.h:4105

    Parameters

    clang::QualType result
    ArrayRef<clang::QualType> params
    clang::QualType canonical
    const clang::FunctionProtoType::ExtProtoInfo& epi

    static void Profile(
        llvm::FoldingSetNodeID& ID,
        clang::QualType Result,
        clang::FunctionProtoType::param_type_iterator
            ArgTys,
        unsigned int NumArgs,
        const clang::FunctionProtoType::ExtProtoInfo&
            EPI,
        const clang::ASTContext& Context,
        bool Canonical)

    Declared at: clang/include/clang/AST/Type.h:4402

    Parameters

    llvm::FoldingSetNodeID& ID
    clang::QualType Result
    clang::FunctionProtoType::param_type_iterator ArgTys
    unsigned int NumArgs
    const clang::FunctionProtoType::ExtProtoInfo& EPI
    const clang::ASTContext& Context
    bool Canonical

    void Profile(llvm::FoldingSetNodeID& ID,
                 const clang::ASTContext& Ctx)

    Declared at: clang/include/clang/AST/Type.h:4401

    Parameters

    llvm::FoldingSetNodeID& ID
    const clang::ASTContext& Ctx

    clang::CanThrowResult canThrow() const

    Description

    Determine whether this function type has a non-throwing exception specification.

    Declared at: clang/include/clang/AST/Type.h:4279

    static bool classof(const clang::Type* T)

    Declared at: clang/include/clang/AST/Type.h:4397

    Parameters

    const clang::Type* T

    static bool containsAnyUnexpandedParameterPack(
        const clang::QualType* ArgArray,
        unsigned int numArgs)

    Description

    Determine whether there are any argument types that contain an unexpanded parameter pack.

    Declared at: clang/include/clang/AST/Type.h:4096

    Parameters

    const clang::QualType* ArgArray
    unsigned int numArgs

    clang::QualType desugar() const

    Declared at: clang/include/clang/AST/Type.h:4392

    clang::FunctionProtoType::exception_iterator
    exception_begin() const

    Declared at: clang/include/clang/AST/Type.h:4340

    clang::FunctionProtoType::exception_iterator
    exception_end() const

    Declared at: clang/include/clang/AST/Type.h:4345

    ArrayRef<clang::QualType> exceptions() const

    Declared at: clang/include/clang/AST/Type.h:4336

    clang::SourceLocation getEllipsisLoc() const

    Declared at: clang/include/clang/AST/Type.h:4291

    clang::FunctionDecl* getExceptionSpecDecl() const

    Description

    If this function type has an exception specification which hasn't been determined yet (either because it has not been evaluated or because it has not been instantiated), this is the function whose exception specification is represented by this type.

    Declared at: clang/include/clang/AST/Type.h:4260

    clang::FunctionProtoType::ExceptionSpecInfo
    getExceptionSpecInfo() const

    Description

    Return all the available information about this type's exception spec.

    Declared at: clang/include/clang/AST/Type.h:4218

    clang::FunctionProtoType::ExceptionSpecSizeHolder
    getExceptionSpecSize() const

    Description

    Return the number and kind of trailing objects related to the exception specification.

    Declared at: clang/include/clang/AST/Type.h:4149

    static clang::FunctionProtoType::
        ExceptionSpecSizeHolder
        getExceptionSpecSize(
            clang::ExceptionSpecificationType EST,
            unsigned int NumExceptions)

    Description

    Return the number and kind of trailing objects related to the exception specification.

    Declared at: clang/include/clang/AST/Type.h:4120

    Parameters

    clang::ExceptionSpecificationType EST
    unsigned int NumExceptions

    clang::FunctionDecl* getExceptionSpecTemplate()
        const

    Description

    If this function type has an uninstantiated exception specification, this is the function whose exception specification should be instantiated to find the exception specification for this type.

    Declared at: clang/include/clang/AST/Type.h:4271

    clang::ExceptionSpecificationType
    getExceptionSpecType() const

    Description

    Get the kind of exception specification on this function.

    Declared at: clang/include/clang/AST/Type.h:4192

    clang::QualType getExceptionType(
        unsigned int i) const

    Description

    Return the ith exception type, where 0 < = i < getNumExceptions().

    Declared at: clang/include/clang/AST/Type.h:4243

    Parameters

    unsigned int i

    clang::FunctionType::ExtParameterInfo
    getExtParameterInfo(unsigned int I) const

    Declared at: clang/include/clang/AST/Type.h:4370

    Parameters

    unsigned int I

    ArrayRef<clang::FunctionType::ExtParameterInfo>
    getExtParameterInfos() const

    Declared at: clang/include/clang/AST/Type.h:4355

    const clang::FunctionType::ExtParameterInfo*
    getExtParameterInfosOrNull() const

    Description

    Return a pointer to the beginning of the array of extra parameter information, if present, or else null if none of the parameters carry it. This is equivalent to getExtProtoInfo().ExtParameterInfos.

    Declared at: clang/include/clang/AST/Type.h:4364

    clang::FunctionProtoType::ExtProtoInfo
    getExtProtoInfo() const

    Declared at: clang/include/clang/AST/Type.h:4178

    clang::Qualifiers getMethodQuals() const

    Declared at: clang/include/clang/AST/Type.h:4307

    clang::Expr* getNoexceptExpr() const

    Description

    Return the expression inside noexcept(expression), or a null pointer if there is none (because the exception spec is not of this form).

    Declared at: clang/include/clang/AST/Type.h:4250

    unsigned int getNumExceptions() const

    Description

    Return the number of types in the exception specification.

    Declared at: clang/include/clang/AST/Type.h:4235

    unsigned int getNumParams() const

    Declared at: clang/include/clang/AST/Type.h:4167

    clang::QualType getParamType(unsigned int i) const

    Declared at: clang/include/clang/AST/Type.h:4169

    Parameters

    unsigned int i

    ArrayRef<clang::QualType> getParamTypes() const

    Declared at: clang/include/clang/AST/Type.h:4174

    clang::ParameterABI getParameterABI(
        unsigned int I) const

    Declared at: clang/include/clang/AST/Type.h:4377

    Parameters

    unsigned int I

    clang::RefQualifierKind getRefQualifier() const

    Description

    Retrieve the ref-qualifier associated with this function type.

    Declared at: clang/include/clang/AST/Type.h:4315

    bool hasDependentExceptionSpec() const

    Description

    Return whether this function has a dependent exception spec.

    Declared at: clang/include/clang/AST/Type.h:4211

    bool hasDynamicExceptionSpec() const

    Description

    Return whether this function has a dynamic (throw) exception spec.

    Declared at: clang/include/clang/AST/Type.h:4201

    bool hasExceptionSpec() const

    Description

    Return whether this function has any kind of exception spec.

    Declared at: clang/include/clang/AST/Type.h:4198

    bool hasExtParameterInfos() const

    Description

    Is there any interesting extra information for any of the parameters of this function type?

    Declared at: clang/include/clang/AST/Type.h:4351

    bool hasExtQualifiers() const

    Declared at: clang/include/clang/AST/Type.h:4162

    bool hasExtraBitfields() const

    Description

    Whether the trailing FunctionTypeExtraBitfields is present.

    Declared at: clang/include/clang/AST/Type.h:4154

    bool hasInstantiationDependentExceptionSpec()
        const

    Description

    Return whether this function has an instantiation-dependent exception spec.

    Declared at: clang/include/clang/AST/Type.h:4215

    bool hasNoexceptExceptionSpec() const

    Description

    Return whether this function has a noexcept exception spec.

    Declared at: clang/include/clang/AST/Type.h:4206

    bool hasTrailingReturn() const

    Description

    Whether this function prototype has a trailing return type.

    Declared at: clang/include/clang/AST/Type.h:4305

    bool isNothrow(
        bool ResultIfDependent = false) const

    Description

    Determine whether this function type has a non-throwing exception specification. If this depends on template arguments, returns\c ResultIfDependent.

    Declared at: clang/include/clang/AST/Type.h:4284

    Parameters

    bool ResultIfDependent = false

    bool isParamConsumed(unsigned int I) const

    Declared at: clang/include/clang/AST/Type.h:4384

    Parameters

    unsigned int I

    bool isSugared() const

    Declared at: clang/include/clang/AST/Type.h:4391

    bool isTemplateVariadic() const

    Description

    Determines whether this function prototype contains a parameter pack at the end. A function template whose last parameter is a parameter pack can be called with an arbitrary number of arguments, much like a variadic function.

    Declared at: clang/include/clang/AST/Type.h:4302

    bool isVariadic() const

    Description

    Whether this function prototype is variadic.

    Declared at: clang/include/clang/AST/Type.h:4289

    unsigned int numTrailingObjects(
        OverloadToken<clang::FunctionDecl*>) const

    Declared at: clang/include/clang/AST/Type.h:4086

    Parameters

    OverloadToken<clang::FunctionDecl*>

    unsigned int numTrailingObjects(
        OverloadToken<
            clang::FunctionType::ExtParameterInfo>)
        const

    Declared at: clang/include/clang/AST/Type.h:4090

    Parameters

    OverloadToken< clang::FunctionType::ExtParameterInfo>

    unsigned int numTrailingObjects(
        OverloadToken<clang::QualType>) const

    Declared at: clang/include/clang/AST/Type.h:4066

    Parameters

    OverloadToken<clang::QualType>

    unsigned int numTrailingObjects(
        OverloadToken<clang::Expr*>) const

    Declared at: clang/include/clang/AST/Type.h:4082

    Parameters

    OverloadToken<clang::Expr*>

    unsigned int numTrailingObjects(
        OverloadToken<
            clang::FunctionType::ExceptionType>) const

    Declared at: clang/include/clang/AST/Type.h:4078

    Parameters

    OverloadToken<clang::FunctionType::ExceptionType>

    unsigned int numTrailingObjects(
        OverloadToken<clang::FunctionType::
                          FunctionTypeExtraBitfields>)
        const

    Declared at: clang/include/clang/AST/Type.h:4074

    Parameters

    OverloadToken<clang::FunctionType:: FunctionTypeExtraBitfields>

    unsigned int numTrailingObjects(
        OverloadToken<clang::SourceLocation>) const

    Declared at: clang/include/clang/AST/Type.h:4070

    Parameters

    OverloadToken<clang::SourceLocation>

    clang::FunctionProtoType::param_type_iterator
    param_type_begin() const

    Declared at: clang/include/clang/AST/Type.h:4326

    clang::FunctionProtoType::param_type_iterator
    param_type_end() const

    Declared at: clang/include/clang/AST/Type.h:4330

    clang::FunctionProtoType::param_type_range
    param_types() const

    Declared at: clang/include/clang/AST/Type.h:4322

    void printExceptionSpecification(
        llvm::raw_ostream& OS,
        const clang::PrintingPolicy& Policy) const

    Declared at: clang/include/clang/AST/Type.h:4394

    Parameters

    llvm::raw_ostream& OS
    const clang::PrintingPolicy& Policy