clang  8.0.0svn
Public Member Functions | Public Attributes | List of all members
clang::DeclaratorChunk::FunctionTypeInfo Struct Reference

#include "clang/Sema/DeclSpec.h"

Collaboration diagram for clang::DeclaratorChunk::FunctionTypeInfo:
Collaboration graph
[legend]

Public Member Functions

void freeParams ()
 Reset the parameter list to having zero parameters. More...
 
void destroy ()
 
bool isKNRPrototype () const
 isKNRPrototype - Return true if this is a K&R style identifier list, like "void foo(a,b,c)". More...
 
SourceLocation getLParenLoc () const
 
SourceLocation getEllipsisLoc () const
 
SourceLocation getRParenLoc () const
 
SourceLocation getExceptionSpecLocBeg () const
 
SourceLocation getExceptionSpecLocEnd () const
 
SourceRange getExceptionSpecRange () const
 
SourceLocation getRefQualifierLoc () const
 Retrieve the location of the ref-qualifier, if any. More...
 
SourceLocation getConstQualifierLoc () const
 Retrieve the location of the 'const' qualifier, if any. More...
 
SourceLocation getVolatileQualifierLoc () const
 Retrieve the location of the 'volatile' qualifier, if any. More...
 
SourceLocation getRestrictQualifierLoc () const
 Retrieve the location of the 'restrict' qualifier, if any. More...
 
SourceLocation getMutableLoc () const
 Retrieve the location of the 'mutable' qualifier, if any. More...
 
bool hasRefQualifier () const
 Determine whether this function declaration contains a ref-qualifier. More...
 
bool hasMutableQualifier () const
 Determine whether this lambda-declarator contains a 'mutable' qualifier. More...
 
ExceptionSpecificationType getExceptionSpecType () const
 Get the type of exception specification this function has. More...
 
unsigned getNumExceptions () const
 Get the number of dynamic exception specifications. More...
 
ArrayRef< NamedDecl * > getDeclsInPrototype () const
 Get the non-parameter decls defined within this function prototype. More...
 
bool hasTrailingReturnType () const
 Determine whether this function declarator had a trailing-return-type. More...
 
ParsedType getTrailingReturnType () const
 Get the trailing-return-type for this function declarator. More...
 

Public Attributes

unsigned hasPrototype: 1
 hasPrototype - This is true if the function had at least one typed parameter. More...
 
unsigned isVariadic: 1
 isVariadic - If this function has a prototype, and if that proto ends with ',...)', this is true. More...
 
unsigned isAmbiguous: 1
 Can this declaration be a constructor-style initializer? More...
 
unsigned RefQualifierIsLValueRef: 1
 Whether the ref-qualifier (if any) is an lvalue reference. More...
 
unsigned TypeQuals: 4
 The type qualifiers: const/volatile/restrict/__unaligned The qualifier bitmask values are the same as in QualType. More...
 
unsigned ExceptionSpecType: 4
 ExceptionSpecType - An ExceptionSpecificationType value. More...
 
unsigned DeleteParams: 1
 DeleteParams - If this is true, we need to delete[] Params. More...
 
unsigned HasTrailingReturnType: 1
 HasTrailingReturnType - If this is true, a trailing return type was specified. More...
 
unsigned LParenLoc
 The location of the left parenthesis in the source. More...
 
unsigned EllipsisLoc
 When isVariadic is true, the location of the ellipsis in the source. More...
 
unsigned RParenLoc
 The location of the right parenthesis in the source. More...
 
unsigned NumParams
 NumParams - This is the number of formal parameters specified by the declarator. More...
 
unsigned NumExceptionsOrDecls
 NumExceptionsOrDecls - This is the number of types in the dynamic-exception-decl, if the function has one. More...
 
unsigned RefQualifierLoc
 The location of the ref-qualifier, if any. More...
 
unsigned ConstQualifierLoc
 The location of the const-qualifier, if any. More...
 
unsigned VolatileQualifierLoc
 The location of the volatile-qualifier, if any. More...
 
unsigned RestrictQualifierLoc
 The location of the restrict-qualifier, if any. More...
 
unsigned MutableLoc
 The location of the 'mutable' qualifer in a lambda-declarator, if any. More...
 
unsigned ExceptionSpecLocBeg
 The beginning location of the exception specification, if any. More...
 
unsigned ExceptionSpecLocEnd
 The end location of the exception specification, if any. More...
 
ParamInfoParams
 Params - This is a pointer to a new[]'d array of ParamInfo objects that describe the parameters specified by this function declarator. More...
 
union {
   TypeAndRange *   Exceptions
 Pointer to a new[]'d array of TypeAndRange objects that contain the types in the function's dynamic exception specification and their locations, if there is one. More...
 
   Expr *   NoexceptExpr
 Pointer to the expression in the noexcept-specifier of this function, if it has one. More...
 
   CachedTokens *   ExceptionSpecTokens
 Pointer to the cached tokens for an exception-specification that has not yet been parsed. More...
 
   NamedDecl **   DeclsInPrototype
 Pointer to a new[]'d array of declarations that need to be available for lookup inside the function body, if one exists. More...
 
}; 
 
UnionParsedType TrailingReturnType
 If HasTrailingReturnType is true, this is the trailing return type specified. More...
 

Detailed Description

Definition at line 1235 of file DeclSpec.h.

Member Function Documentation

◆ destroy()

void clang::DeclaratorChunk::FunctionTypeInfo::destroy ( )
inline

Definition at line 1357 of file DeclSpec.h.

References clang::EST_Dynamic, clang::EST_None, and clang::EST_Unparsed.

◆ freeParams()

void clang::DeclaratorChunk::FunctionTypeInfo::freeParams ( )
inline

Reset the parameter list to having zero parameters.

This is used in various places for error recovery.

Definition at line 1347 of file DeclSpec.h.

Referenced by clang::Sema::CheckConversionDeclarator(), and clang::Sema::CheckDestructorDeclarator().

◆ getConstQualifierLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getConstQualifierLoc ( ) const
inline

Retrieve the location of the 'const' qualifier, if any.

Definition at line 1410 of file DeclSpec.h.

References clang::SourceLocation::getFromRawEncoding().

◆ getDeclsInPrototype()

ArrayRef<NamedDecl *> clang::DeclaratorChunk::FunctionTypeInfo::getDeclsInPrototype ( ) const
inline

Get the non-parameter decls defined within this function prototype.

Typically these are tag declarations.

Definition at line 1450 of file DeclSpec.h.

References clang::EST_None.

◆ getEllipsisLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getEllipsisLoc ( ) const
inline

Definition at line 1384 of file DeclSpec.h.

References clang::SourceLocation::getFromRawEncoding().

◆ getExceptionSpecLocBeg()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecLocBeg ( ) const
inline

Definition at line 1392 of file DeclSpec.h.

References clang::SourceLocation::getFromRawEncoding().

◆ getExceptionSpecLocEnd()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecLocEnd ( ) const
inline

Definition at line 1396 of file DeclSpec.h.

References clang::SourceLocation::getFromRawEncoding().

◆ getExceptionSpecRange()

SourceRange clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecRange ( ) const
inline

Definition at line 1400 of file DeclSpec.h.

◆ getExceptionSpecType()

ExceptionSpecificationType clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecType ( ) const
inline

Get the type of exception specification this function has.

Definition at line 1438 of file DeclSpec.h.

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

◆ getLParenLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getLParenLoc ( ) const
inline

Definition at line 1380 of file DeclSpec.h.

References clang::SourceLocation::getFromRawEncoding().

◆ getMutableLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getMutableLoc ( ) const
inline

Retrieve the location of the 'mutable' qualifier, if any.

Definition at line 1425 of file DeclSpec.h.

References clang::SourceLocation::getFromRawEncoding().

◆ getNumExceptions()

unsigned clang::DeclaratorChunk::FunctionTypeInfo::getNumExceptions ( ) const
inline

Get the number of dynamic exception specifications.

Definition at line 1443 of file DeclSpec.h.

References clang::EST_None.

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

◆ getRefQualifierLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getRefQualifierLoc ( ) const
inline

Retrieve the location of the ref-qualifier, if any.

Definition at line 1405 of file DeclSpec.h.

References clang::SourceLocation::getFromRawEncoding().

Referenced by clang::Sema::CheckConstructorDeclarator(), and clang::Sema::CheckDestructorDeclarator().

◆ getRestrictQualifierLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getRestrictQualifierLoc ( ) const
inline

Retrieve the location of the 'restrict' qualifier, if any.

Definition at line 1420 of file DeclSpec.h.

References clang::SourceLocation::getFromRawEncoding().

◆ getRParenLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getRParenLoc ( ) const
inline

Definition at line 1388 of file DeclSpec.h.

References clang::SourceLocation::getFromRawEncoding().

◆ getTrailingReturnType()

ParsedType clang::DeclaratorChunk::FunctionTypeInfo::getTrailingReturnType ( ) const
inline

Get the trailing-return-type for this function declarator.

Definition at line 1460 of file DeclSpec.h.

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

◆ getVolatileQualifierLoc()

SourceLocation clang::DeclaratorChunk::FunctionTypeInfo::getVolatileQualifierLoc ( ) const
inline

Retrieve the location of the 'volatile' qualifier, if any.

Definition at line 1415 of file DeclSpec.h.

References clang::SourceLocation::getFromRawEncoding().

◆ hasMutableQualifier()

bool clang::DeclaratorChunk::FunctionTypeInfo::hasMutableQualifier ( ) const
inline

Determine whether this lambda-declarator contains a 'mutable' qualifier.

Definition at line 1435 of file DeclSpec.h.

◆ hasRefQualifier()

bool clang::DeclaratorChunk::FunctionTypeInfo::hasRefQualifier ( ) const
inline

Determine whether this function declaration contains a ref-qualifier.

Definition at line 1431 of file DeclSpec.h.

Referenced by clang::Sema::CheckConstructorDeclarator(), and clang::Sema::CheckDestructorDeclarator().

◆ hasTrailingReturnType()

bool clang::DeclaratorChunk::FunctionTypeInfo::hasTrailingReturnType ( ) const
inline

Determine whether this function declarator had a trailing-return-type.

Definition at line 1457 of file DeclSpec.h.

Referenced by clang::Sema::containsUnexpandedParameterPacks(), and diagnoseRedundantReturnTypeQualifiers().

◆ isKNRPrototype()

bool clang::DeclaratorChunk::FunctionTypeInfo::isKNRPrototype ( ) const
inline

isKNRPrototype - Return true if this is a K&R style identifier list, like "void foo(a,b,c)".

In a function definition, this will be followed by the parameter type definitions.

Definition at line 1378 of file DeclSpec.h.

Referenced by clang::Parser::ParseTopLevelDecl().

Member Data Documentation

◆ @218

union { ... }

◆ ConstQualifierLoc

unsigned clang::DeclaratorChunk::FunctionTypeInfo::ConstQualifierLoc

The location of the const-qualifier, if any.

If this is an invalid location, there is no const-qualifier.

Definition at line 1293 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().

◆ DeclsInPrototype

NamedDecl** clang::DeclaratorChunk::FunctionTypeInfo::DeclsInPrototype

Pointer to a new[]'d array of declarations that need to be available for lookup inside the function body, if one exists.

Does not exist in C++.

Definition at line 1337 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().

◆ DeleteParams

unsigned clang::DeclaratorChunk::FunctionTypeInfo::DeleteParams

DeleteParams - If this is true, we need to delete[] Params.

Definition at line 1261 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().

◆ EllipsisLoc

unsigned clang::DeclaratorChunk::FunctionTypeInfo::EllipsisLoc

When isVariadic is true, the location of the ellipsis in the source.

Definition at line 1271 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().

◆ Exceptions

TypeAndRange* clang::DeclaratorChunk::FunctionTypeInfo::Exceptions

Pointer to a new[]'d array of TypeAndRange objects that contain the types in the function's dynamic exception specification and their locations, if there is one.

Definition at line 1324 of file DeclSpec.h.

Referenced by clang::Sema::containsUnexpandedParameterPacks(), and clang::DeclaratorChunk::getFunction().

◆ ExceptionSpecLocBeg

unsigned clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecLocBeg

The beginning location of the exception specification, if any.

Definition at line 1310 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().

◆ ExceptionSpecLocEnd

unsigned clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecLocEnd

The end location of the exception specification, if any.

Definition at line 1313 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().

◆ ExceptionSpecTokens

CachedTokens* clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecTokens

Pointer to the cached tokens for an exception-specification that has not yet been parsed.

Definition at line 1332 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().

◆ ExceptionSpecType

unsigned clang::DeclaratorChunk::FunctionTypeInfo::ExceptionSpecType

ExceptionSpecType - An ExceptionSpecificationType value.

Definition at line 1258 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().

◆ hasPrototype

unsigned clang::DeclaratorChunk::FunctionTypeInfo::hasPrototype

hasPrototype - This is true if the function had at least one typed parameter.

If the function is () or (a,b,c), then it has no prototype, and is treated as a K&R-style function.

Definition at line 1239 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction(), and maybeSynthesizeBlockSignature().

◆ HasTrailingReturnType

unsigned clang::DeclaratorChunk::FunctionTypeInfo::HasTrailingReturnType

HasTrailingReturnType - If this is true, a trailing return type was specified.

Definition at line 1265 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().

◆ isAmbiguous

unsigned clang::DeclaratorChunk::FunctionTypeInfo::isAmbiguous

Can this declaration be a constructor-style initializer?

Definition at line 1247 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction(), and warnAboutAmbiguousFunction().

◆ isVariadic

unsigned clang::DeclaratorChunk::FunctionTypeInfo::isVariadic

isVariadic - If this function has a prototype, and if that proto ends with ',...)', this is true.

When true, EllipsisLoc contains the location of the ellipsis.

Definition at line 1244 of file DeclSpec.h.

Referenced by clang::Sema::CheckDestructorDeclarator(), clang::FTIHasSingleVoidParameter(), getCCForDeclaratorChunk(), and clang::DeclaratorChunk::getFunction().

◆ LParenLoc

unsigned clang::DeclaratorChunk::FunctionTypeInfo::LParenLoc

The location of the left parenthesis in the source.

Definition at line 1268 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().

◆ MutableLoc

unsigned clang::DeclaratorChunk::FunctionTypeInfo::MutableLoc

The location of the 'mutable' qualifer in a lambda-declarator, if any.

Definition at line 1307 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().

◆ NoexceptExpr

Expr* clang::DeclaratorChunk::FunctionTypeInfo::NoexceptExpr

Pointer to the expression in the noexcept-specifier of this function, if it has one.

Definition at line 1328 of file DeclSpec.h.

Referenced by clang::Sema::containsUnexpandedParameterPacks(), and clang::DeclaratorChunk::getFunction().

◆ NumExceptionsOrDecls

unsigned clang::DeclaratorChunk::FunctionTypeInfo::NumExceptionsOrDecls

NumExceptionsOrDecls - This is the number of types in the dynamic-exception-decl, if the function has one.

In C, this is the number of declarations in the function prototype.

Definition at line 1283 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().

◆ NumParams

unsigned clang::DeclaratorChunk::FunctionTypeInfo::NumParams

◆ Params

ParamInfo* clang::DeclaratorChunk::FunctionTypeInfo::Params

Params - This is a pointer to a new[]'d array of ParamInfo objects that describe the parameters specified by this function declarator.

null if there are no parameters specified.

Definition at line 1318 of file DeclSpec.h.

Referenced by clang::Sema::CheckExtraCXXDefaultArguments(), clang::Sema::containsUnexpandedParameterPacks(), clang::FTIHasSingleVoidParameter(), clang::DeclaratorChunk::getFunction(), and clang::Parser::ParseTopLevelDecl().

◆ RefQualifierIsLValueRef

unsigned clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierIsLValueRef

Whether the ref-qualifier (if any) is an lvalue reference.

Otherwise, it's an rvalue reference.

Definition at line 1251 of file DeclSpec.h.

Referenced by clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckDestructorDeclarator(), and clang::DeclaratorChunk::getFunction().

◆ RefQualifierLoc

unsigned clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierLoc

The location of the ref-qualifier, if any.

If this is an invalid location, there is no ref-qualifier.

Definition at line 1288 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().

◆ RestrictQualifierLoc

unsigned clang::DeclaratorChunk::FunctionTypeInfo::RestrictQualifierLoc

The location of the restrict-qualifier, if any.

If this is an invalid location, there is no restrict-qualifier.

Definition at line 1303 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().

◆ RParenLoc

unsigned clang::DeclaratorChunk::FunctionTypeInfo::RParenLoc

The location of the right parenthesis in the source.

Definition at line 1274 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().

◆ TrailingReturnType

UnionParsedType clang::DeclaratorChunk::FunctionTypeInfo::TrailingReturnType

If HasTrailingReturnType is true, this is the trailing return type specified.

Definition at line 1342 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().

◆ TypeQuals

unsigned clang::DeclaratorChunk::FunctionTypeInfo::TypeQuals

The type qualifiers: const/volatile/restrict/__unaligned The qualifier bitmask values are the same as in QualType.

Definition at line 1255 of file DeclSpec.h.

Referenced by clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckDestructorDeclarator(), and clang::DeclaratorChunk::getFunction().

◆ VolatileQualifierLoc

unsigned clang::DeclaratorChunk::FunctionTypeInfo::VolatileQualifierLoc

The location of the volatile-qualifier, if any.

If this is an invalid location, there is no volatile-qualifier.

Definition at line 1298 of file DeclSpec.h.

Referenced by clang::DeclaratorChunk::getFunction().


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