28 #include "llvm/ADT/STLExtras.h"
29 #include "llvm/ADT/SmallString.h"
30 #include "llvm/Support/ErrorHandling.h"
32 using namespace clang;
37 return D.
Report(Loc, DiagID);
42 assert(TemplateId &&
"NULL template-id annotation?");
50 assert(TemplateId &&
"NULL template-id annotation?");
59 Builder.
Extend(Context, TemplateKWLoc, TL, ColonColonLoc);
62 Range.
setEnd(ColonColonLoc);
65 "NestedNameSpecifierLoc range computation incorrect");
71 Builder.
Extend(Context, Identifier, IdentifierLoc, ColonColonLoc);
75 Range.
setEnd(ColonColonLoc);
78 "NestedNameSpecifierLoc range computation incorrect");
84 Builder.
Extend(Context, Namespace, NamespaceLoc, ColonColonLoc);
88 Range.
setEnd(ColonColonLoc);
91 "NestedNameSpecifierLoc range computation incorrect");
97 Builder.
Extend(Context, Alias, AliasLoc, ColonColonLoc);
101 Range.
setEnd(ColonColonLoc);
104 "NestedNameSpecifierLoc range computation incorrect");
114 "NestedNameSpecifierLoc range computation incorrect");
120 Builder.
MakeSuper(Context, RD, SuperLoc, ColonColonLoc);
123 Range.
setEnd(ColonColonLoc);
126 "NestedNameSpecifierLoc range computation incorrect");
143 Builder.
Adopt(Other);
170 bool RefQualifierIsLvalueRef,
174 VolatileQualifierLoc,
176 RestrictQualifierLoc,
183 unsigned NumExceptions,
191 "function cannot have _Atomic qualifier");
195 I.
Loc = LocalRangeBegin;
223 assert(I.
Fun.
TypeQuals == TypeQuals &&
"bitfield overflow");
232 if (!TheDeclarator.InlineParamsUsed &&
233 NumParams <= llvm::array_lengthof(TheDeclarator.InlineParams)) {
234 I.
Fun.
Params = TheDeclarator.InlineParams;
236 TheDeclarator.InlineParamsUsed =
true;
241 memcpy(I.
Fun.
Params, Params,
sizeof(Params[0]) * NumParams);
252 for (
unsigned i = 0; i != NumExceptions; ++i) {
271 for (
unsigned i = 0, i_end = DeclTypeInfo.size(); i < i_end; ++i) {
272 switch (DeclTypeInfo[i].
Kind) {
284 llvm_unreachable(
"Invalid type chunk");
322 return E->getType()->isFunctionType();
332 if (
const LocInfoType *LIT = dyn_cast<LocInfoType>(QT))
342 llvm_unreachable(
"Invalid TypeSpecType!");
350 getName().OperatorFunctionId.Operator));
356 return cast<TagDecl>(
getRepAsDecl())->isCompleteDefinition();
374 if (FS_inline_specified || FS_virtual_specified || FS_explicit_specified ||
375 FS_noreturn_specified || FS_forceinline_specified)
381 const char *&PrevSpec,
383 bool IsExtension =
true) {
386 DiagID = diag::err_invalid_decl_spec_combination;
388 DiagID = IsExtension ? diag::ext_duplicate_declspec :
389 diag::warn_duplicate_declspec;
404 llvm_unreachable(
"Unknown typespec!");
414 llvm_unreachable(
"Unknown typespec!");
424 llvm_unreachable(
"Unknown typespec!");
433 llvm_unreachable(
"Unknown typespec!");
443 llvm_unreachable(
"Unknown typespec!");
480 llvm_unreachable(
"Unknown typespec!");
491 llvm_unreachable(
"Unknown typespec!");
495 const char *&PrevSpec,
512 DiagID = diag::err_opencl_unknown_type_specifier;
519 DiagID = diag::err_opencl_unknown_type_specifier;
535 PrevSpec, DiagID, Policy);
536 assert(!isInvalid &&
"auto SCS -> TST recovery failed");
544 !(SCS_extern_in_linkage_spec &&
549 StorageClassSpec = SC;
550 StorageClassSpecLoc = Loc;
551 assert((
unsigned)SC == StorageClassSpec &&
"SCS constants overflow bitfield");
556 const char *&PrevSpec,
561 ThreadStorageClassSpec =
TSC;
562 ThreadStorageClassSpecLoc = Loc;
570 const char *&PrevSpec,
585 const char *&PrevSpec,
595 const char *&PrevSpec,
605 const char *&PrevSpec,
614 const char *&PrevSpec,
618 assert(
isTypeRep(T) &&
"T does not store a type");
619 assert(Rep &&
"no type provided!");
622 DiagID = diag::err_invalid_decl_spec_combination;
628 TSTNameLoc = TagNameLoc;
629 TypeSpecOwned =
false;
634 const char *&PrevSpec,
638 assert(isExprRep(T) &&
"T does not store an expr");
639 assert(Rep &&
"no expression provided!");
642 DiagID = diag::err_invalid_decl_spec_combination;
649 TypeSpecOwned =
false;
654 const char *&PrevSpec,
656 Decl *Rep,
bool Owned,
658 return SetTypeSpecType(T, Loc, Loc, PrevSpec, DiagID, Rep, Owned, Policy);
663 const char *&PrevSpec,
665 Decl *Rep,
bool Owned,
667 assert(
isDeclRep(T) &&
"T does not store a decl");
672 DiagID = diag::err_invalid_decl_spec_combination;
678 TSTNameLoc = TagNameLoc;
679 TypeSpecOwned = Owned && Rep !=
nullptr;
684 const char *&PrevSpec,
688 "rep required for these type-spec kinds!");
691 DiagID = diag::err_invalid_decl_spec_combination;
696 if (TypeAltiVecVector && (T ==
TST_bool) && !TypeAltiVecBool) {
697 TypeAltiVecBool =
true;
701 TypeSpecOwned =
false;
706 const char *&PrevSpec,
unsigned &DiagID,
710 DiagID = diag::err_invalid_vector_decl_spec_combination;
713 TypeAltiVecVector = isAltiVecVector;
719 const char *&PrevSpec,
unsigned &DiagID,
721 if (!TypeAltiVecVector || TypeAltiVecPixel ||
724 DiagID = diag::err_invalid_pixel_decl_spec_combination;
727 TypeAltiVecPixel = isAltiVecPixel;
734 const char *&PrevSpec,
unsigned &DiagID,
736 if (!TypeAltiVecVector || TypeAltiVecBool ||
739 DiagID = diag::err_invalid_vector_bool_decl_spec;
742 TypeAltiVecBool = isAltiVecBool;
750 TypeSpecOwned =
false;
762 if (TypeQualifiers & T) {
763 bool IsExtension =
true;
766 return BadSpecifier(T, T, PrevSpec, DiagID, IsExtension);
772 case TQ_const: TQ_constLoc = Loc;
return false;
773 case TQ_restrict: TQ_restrictLoc = Loc;
return false;
774 case TQ_volatile: TQ_volatileLoc = Loc;
return false;
775 case TQ_atomic: TQ_atomicLoc = Loc;
return false;
778 llvm_unreachable(
"Unknown type qualifier!");
785 if (FS_inline_specified) {
786 DiagID = diag::warn_duplicate_declspec;
790 FS_inline_specified =
true;
797 if (FS_forceinline_specified) {
798 DiagID = diag::warn_duplicate_declspec;
799 PrevSpec =
"__forceinline";
802 FS_forceinline_specified =
true;
803 FS_forceinlineLoc = Loc;
808 const char *&PrevSpec,
812 if (FS_virtual_specified) {
813 DiagID = diag::warn_duplicate_declspec;
814 PrevSpec =
"virtual";
817 FS_virtual_specified =
true;
823 const char *&PrevSpec,
827 if (FS_explicit_specified) {
828 DiagID = diag::warn_duplicate_declspec;
829 PrevSpec =
"explicit";
832 FS_explicit_specified =
true;
833 FS_explicitLoc = Loc;
838 const char *&PrevSpec,
842 if (FS_noreturn_specified) {
843 DiagID = diag::warn_duplicate_declspec;
844 PrevSpec =
"_Noreturn";
847 FS_noreturn_specified =
true;
848 FS_noreturnLoc = Loc;
854 if (Friend_specified) {
861 DiagID = diag::warn_duplicate_declspec;
865 Friend_specified =
true;
873 PrevSpec =
"__module_private__";
874 DiagID = diag::ext_duplicate_declspec;
878 ModulePrivateLoc = Loc;
886 if (Constexpr_specified) {
887 DiagID = diag::warn_duplicate_declspec;
888 PrevSpec =
"constexpr";
891 Constexpr_specified =
true;
898 if (Concept_specified) {
899 DiagID = diag::ext_duplicate_declspec;
900 PrevSpec =
"concept";
903 Concept_specified =
true;
908 void DeclSpec::SaveWrittenBuiltinSpecs() {
916 if (attrs->
getKind() == AttributeList::AT_Mode) {
930 SaveWrittenBuiltinSpecs();
939 TypeAltiVecVector || TypeAltiVecPixel || TypeAltiVecBool ||
941 const unsigned NumLocs = 8;
943 TSWLoc, TSCLoc, TSSLoc, AltiVecLoc,
944 TQ_constLoc, TQ_restrictLoc, TQ_volatileLoc, TQ_atomicLoc
948 for (
unsigned I = 0; I != NumLocs; ++I) {
953 FirstLoc = ExtraLocs[I];
960 TypeAltiVecVector = TypeAltiVecPixel = TypeAltiVecBool =
false;
962 Diag(D, TSTLoc, diag::err_decltype_auto_cannot_be_combined)
963 << Hints[0] << Hints[1] << Hints[2] << Hints[3]
964 << Hints[4] << Hints[5] << Hints[6] << Hints[7];
968 if (TypeAltiVecVector) {
969 if (TypeAltiVecBool) {
972 Diag(D, TSSLoc, diag::err_invalid_vector_bool_decl_spec)
978 (TypeSpecType !=
TST_int)) || TypeAltiVecPixel) {
979 Diag(D, TSTLoc, diag::err_invalid_vector_bool_decl_spec)
980 << (TypeAltiVecPixel ?
"__pixel" :
987 Diag(D, TSWLoc, diag::err_invalid_vector_bool_decl_spec)
995 Diag(D, TSTLoc, diag::err_invalid_vector_long_long_decl_spec);
1005 Diag(D, TSWLoc, diag::err_invalid_vector_long_double_decl_spec);
1008 Diag(D, TSTLoc, diag::err_invalid_vector_double_decl_spec);
1012 Diag(D, TSTLoc, diag::err_invalid_vector_float_decl_spec);
1013 }
else if (TypeSpecWidth ==
TSW_long) {
1016 Diag(D, TSWLoc, diag::err_invalid_vector_long_decl_spec);
1018 Diag(D, TSWLoc, diag::warn_vector_long_decl_spec_combination)
1022 if (TypeAltiVecPixel) {
1027 TypeSpecOwned =
false;
1037 Diag(D, TSSLoc, diag::err_invalid_sign_spec)
1045 switch (TypeSpecWidth) {
1051 else if (TypeSpecType !=
TST_int) {
1053 TypeSpecWidth ==
TSW_short ? diag::err_invalid_short_spec
1054 : diag::err_invalid_longlong_spec)
1057 TypeSpecOwned =
false;
1064 Diag(D, TSWLoc, diag::err_invalid_long_spec)
1067 TypeSpecOwned =
false;
1076 Diag(D, TSCLoc, diag::ext_plain_complex)
1084 Diag(D, TSTLoc, diag::ext_integer_complex);
1086 Diag(D, TSCLoc, diag::err_invalid_complex_spec)
1096 switch (StorageClassSpec) {
1106 diag::err_invalid_decl_spec_combination)
1111 diag::err_invalid_decl_spec_combination)
1128 TSTLoc = TSTNameLoc = StorageClassSpecLoc;
1134 Diag(D, TSTLoc, diag::ext_auto_type_specifier);
1137 Diag(D, StorageClassSpecLoc, diag::warn_auto_storage_class)
1140 Diag(D, TSTLoc, diag::warn_cxx98_compat_unicode_type)
1141 << (TypeSpecType ==
TST_char16 ?
"char16_t" :
"char32_t");
1142 if (Constexpr_specified)
1143 Diag(D, ConstexprLoc, diag::warn_cxx98_compat_constexpr);
1161 if (!SpecName.empty()) SpecName +=
" ";
1167 Diag(D, SCLoc, diag::err_friend_decl_spec)
1168 << SpecName << StorageHint << ThreadHint;
1185 Keyword =
"virtual";
1188 Keyword =
"explicit";
1193 Diag(D, SCLoc, diag::err_friend_decl_spec)
1196 FS_virtual_specified = FS_explicit_specified =
false;
1200 assert(!TypeSpecOwned ||
isDeclRep((
TST) TypeSpecType));
1222 for (
unsigned I = 0; I != 3; ++I) {
1225 if (SymbolLocations[I].
isValid())
1231 const char *&PrevSpec) {
1233 FirstLocation = Loc;
1237 if (Specifiers & VS) {
1245 default: llvm_unreachable(
"Unknown specifier!");
1248 case VS_Final: VS_finalLoc = Loc;
break;
1256 default: llvm_unreachable(
"Unknown specifier");
SourceLocation getThreadStorageClassSpecLoc() const
SourceManager & getSourceManager() const
Defines the clang::ASTContext interface.
unsigned MutableLoc
The location of the 'mutable' qualifer in a lambda-declarator, if any.
NestedNameSpecifier * getRepresentation() const
Retrieve the representation of the nested-name-specifier.
unsigned RefQualifierIsLValueRef
Whether the ref-qualifier (if any) is an lvalue reference. Otherwise, it's an rvalue reference...
void MakeSuper(ASTContext &Context, CXXRecordDecl *RD, SourceLocation SuperLoc, SourceLocation ColonColonLoc)
Turns this (empty) nested-name-specifier into '__super' nested-name-specifier.
void MakeTrivial(ASTContext &Context, NestedNameSpecifier *Qualifier, SourceRange R)
Make a new nested-name-specifier from incomplete source-location information.
SourceLocation getExplicitSpecLoc() const
TSW getTypeSpecWidth() const
static const TSS TSS_unsigned
unsigned RestrictQualifierLoc
The location of the restrict-qualifier, if any.
SourceLocation StartLocation
The location of the first token that describes this unqualified-id, which will be the location of the...
TheContext getContext() const
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range covering the entirety of this nested-name-specifier.
static const TST TST_wchar
Decl * getRepAsDecl() const
const LangOptions & getLangOpts() const
SourceLocation TemplateNameLoc
unsigned MSWChar
When true, print the built-in wchar_t type as __wchar_t. For use in Microsoft mode when wchar_t is no...
static const TST TST_typeofExpr
static const TST TST_char16
bool SetConstexprSpec(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
unsigned EllipsisLoc
When isVariadic is true, the location of the ellipsis in the source.
SCS getStorageClassSpec() const
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
One instance of this struct is used for each type in a declarator that is parsed. ...
NamespaceDecl - Represent a C++ namespace.
SourceLocation EndLoc
EndLoc - If valid, the place where this chunck ends.
static const char * getSpecifierName(DeclSpec::TST T, const PrintingPolicy &Policy)
Turn a type-specifier-type into a string like "_Bool" or "union".
static const char * getSpecifierName(Specifier VS)
bool SetTypeAltiVecBool(bool isAltiVecBool, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
unsigned getRawEncoding() const
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it...
unsigned RefQualifierLoc
The location of the ref-qualifier, if any.
void Adopt(NestedNameSpecifierLoc Other)
Adopt an existing nested-name-specifier (with source-range information).
static const TSCS TSCS_unspecified
static const TST TST_underlyingType
Information about one declarator, including the parsed type information and the identifier.
bool setFunctionSpecExplicit(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
TypeSpecifierType
Specifies the kind of type.
static const TST TST_interface
static const TST TST_char
void setBegin(SourceLocation b)
Describes how types, statements, expressions, and declarations should be printed. ...
void Finish(DiagnosticsEngine &D, Preprocessor &PP, const PrintingPolicy &Policy)
void Adopt(NestedNameSpecifierLoc Other)
Adopt an existing nested-name-specifier (with source-range information).
OpenCLOptions & getOpenCLOptions()
Information about a template-id annotation token.
static const TST TST_unknown_anytype
Base wrapper for a particular "section" of type source info.
SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset=0)
Computes the source location just past the end of the token at this source location.
TemplateIdAnnotation * TemplateId
When Kind == IK_TemplateId or IK_ConstructorTemplateId, the template-id annotation that contains the ...
Expr * NoexceptExpr
Pointer to the expression in the noexcept-specifier of this function, if it has one.
void setConstructorTemplateId(TemplateIdAnnotation *TemplateId)
Specify that this unqualified-id was parsed as a template-id that names a constructor.
static const TST TST_decimal32
unsigned ExceptionSpecLoc
The location of the keyword introducing the spec, if any.
AttributeList * getList() const
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
TypeSpecifierSign
Specifies the signedness of a type, e.g., signed or unsigned.
unsigned VolatileQualifierLoc
The location of the volatile-qualifier, if any.
TSS getTypeSpecSign() const
static const TST TST_class
OverloadedOperatorKind Operator
The kind of overloaded operator.
static const TST TST_double
struct OFI OperatorFunctionId
When Kind == IK_OperatorFunctionId, the overloaded operator that we parsed.
bool setFunctionSpecVirtual(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
const LangOptions & getLangOpts() const
static const TST TST_error
static const TST TST_enum
static const TSW TSW_unspecified
void ClearStorageClassSpecs()
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
bool SetTypeAltiVecPixel(bool isAltiVecPixel, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
SourceLocation getBeginLoc() const
Get the begin source location.
bool setFunctionSpecForceInline(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
SCS
storage-class-specifier
Concrete class used by the front-end to report problems and issues.
unsigned HasTrailingReturnType
bool SetFriendSpec(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
unsigned RParenLoc
The location of the right parenthesis in the source.
bool setFunctionSpecNoreturn(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const
Retrieve a nested-name-specifier with location information, copied into the given AST context...
const TargetInfo & getTargetInfo() const
void setTemplateId(TemplateIdAnnotation *TemplateId)
Specify that this unqualified-id was parsed as a template-id.
static const TST TST_float
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range covered by this nested-name-specifier.
Sema - This implements semantic analysis and AST building for C.
static const TSW TSW_long
A little helper class used to produce diagnostics.
TST getTypeSpecType() const
void MakeTrivial(ASTContext &Context, NestedNameSpecifier *Qualifier, SourceRange R)
Make a new nested-name-specifier from incomplete source-location information.
Holds a QualType and a TypeSourceInfo* that came out of a declarator parsing.
static bool isDeclRep(TST T)
Defines the clang::LangOptions interface.
bool isDeclarationOfFunction() const
Determine whether the declaration that will be produced from this declaration will be a function...
SourceLocation getTypeSpecComplexLoc() const
bool isBeforeInTranslationUnit(SourceLocation LHS, SourceLocation RHS) const
Determines the order of 2 source locations in the translation unit.
unsigned SymbolLocations[3]
The source locations of the individual tokens that name the operator, e.g., the "new", "[", and "]" tokens in operator new [].
This file defines the classes used to store parsed information about declaration-specifiers and decla...
Defines the clang::Preprocessor interface.
static const TST TST_decimal64
Defines the clang::TypeLoc interface and its subclasses.
CachedTokens * ExceptionSpecTokens
Pointer to the cached tokens for an exception-specification that has not yet been parsed...
bool hasTypeSpecifier() const
Return true if any type-specifier has been found.
SourceLocation Loc
Loc - The place where this type was defined.
bool SetTypeSpecSign(TSS S, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
static const TST TST_half
Wraps an identifier and optional source location for the identifier.
SourceLocation getStorageClassSpecLoc() const
static bool BadSpecifier(T TNew, T TPrev, const char *&PrevSpec, unsigned &DiagID, bool IsExtension=true)
static const TSW TSW_short
bool isVirtualSpecified() const
UnionParsedType TrailingReturnType
If HasTrailingReturnType is true, this is the trailing return type specified.
bool SetTypeSpecWidth(TSW W, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
bool isValid() const
Determine whether this unqualified-id refers to a valid name.
TypeAndRange * Exceptions
Pointer to a new[]'d array of TypeAndRange objects that contain the types in the function's dynamic e...
static const TST TST_char32
unsigned Bool
Whether we can use 'bool' rather than '_Bool', even if the language doesn't actually have 'bool' (bec...
SourceLocation getLastQualifierNameLoc() const
Retrieve the location of the name in the last qualifier in this nested name specifier.
bool SetConceptSpec(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
void MakeSuper(ASTContext &Context, CXXRecordDecl *RD, SourceLocation SuperLoc, SourceLocation ColonColonLoc)
Turns this (empty) nested-name-specifier into '__super' nested-name-specifier.
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
An overloaded operator name, e.g., operator+.
Expr * getRepAsExpr() const
UnqualifiedId & getName()
Retrieve the name specified by this declarator.
bool isValid() const
Return true if this is a valid SourceLocation object.
NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const
Retrieve a nested-name-specifier with location information, copied into the given AST context...
NestedNameSpecifierLoc getTemporary() const
Retrieve a nested-name-specifier with location information based on the information in this builder...
static const TST TST_union
bool SetStorageClassSpec(Sema &S, SCS SC, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
ParsedType getRepAsType() const
SourceLocation getLocalBeginLoc() const
Retrieve the location of the beginning of this component of the nested-name-specifier.
static const TSS TSS_signed
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc)
Turn this (empty) nested-name-specifier into the global nested-name-specifier '::'.
static DeclaratorChunk getFunction(bool HasProto, bool IsAmbiguous, SourceLocation LParenLoc, ParamInfo *Params, unsigned NumParams, SourceLocation EllipsisLoc, SourceLocation RParenLoc, unsigned TypeQuals, bool RefQualifierIsLvalueRef, SourceLocation RefQualifierLoc, SourceLocation ConstQualifierLoc, SourceLocation VolatileQualifierLoc, SourceLocation RestrictQualifierLoc, SourceLocation MutableLoc, ExceptionSpecificationType ESpecType, SourceLocation ESpecLoc, ParsedType *Exceptions, SourceRange *ExceptionRanges, unsigned NumExceptions, Expr *NoexceptExpr, CachedTokens *ExceptionSpecTokens, SourceLocation LocalRangeBegin, SourceLocation LocalRangeEnd, Declarator &TheDeclarator, TypeResult TrailingReturnType=TypeResult())
SourceLocation getVirtualSpecLoc() const
static const TST TST_typeofType
SourceLocation getBegin() const
bool SetTypeQual(TQ T, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const LangOptions &Lang)
bool SetTypeAltiVecVector(bool isAltiVecVector, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
A constructor named via a template-id.
static const TST TST_decltype_auto
bool setModulePrivateSpec(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
static bool isStaticOverloadedOperator(OverloadedOperatorKind OOK)
TSCS getThreadStorageClassSpec() const
static const TSS TSS_unspecified
static const TST TST_decltype
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
static const TST TST_auto
bool isFriendSpecified() const
static const TST TST_void
static const TST TST_int128
unsigned DeleteParams
DeleteParams - If this is true, we need to delete[] Params.
bool isMissingDeclaratorOk()
Checks if this DeclSpec can stand alone, without a Declarator.
static FixItHint CreateRemoval(CharSourceRange RemoveRange)
Create a code modification hint that removes the given source range.
bool hasTagDefinition() const
unsigned ConstQualifierLoc
The location of the const-qualifier, if any.
static const TST TST_unspecified
enum clang::DeclaratorChunk::@184 Kind
static DiagnosticBuilder Diag(DiagnosticsEngine &D, SourceLocation Loc, unsigned DiagID)
bool SetSpecifier(Specifier VS, SourceLocation Loc, const char *&PrevSpec)
static const TST TST_decimal128
static const TSCS TSCS___thread
unsigned LParenLoc
The location of the left parenthesis in the source.
bool isFunctionType() const
bool SetStorageClassSpecThread(TSCS TSC, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
void setOperatorFunctionId(SourceLocation OperatorLoc, OverloadedOperatorKind Op, SourceLocation SymbolLocations[3])
Specify that this unqualified-id was parsed as an operator-function-id.
static const TST TST_typename
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
static bool isInvalid(SourceLocation Loc, bool *Invalid)
static FixItHint CreateInsertion(SourceLocation InsertionLoc, StringRef Code, bool BeforePreviousInsertions=false)
Create a code modification hint that inserts the given code string at a specific location.
A template-id, e.g., f<int>.
bool SetTypeSpecType(TST T, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
void Extend(ASTContext &Context, SourceLocation TemplateKWLoc, TypeLoc TL, SourceLocation ColonColonLoc)
Extend the current nested-name-specifier by another nested-name-specifier component of the form 'type...
unsigned ExceptionSpecType
ExceptionSpecType - An ExceptionSpecificationType value.
ThreadStorageClassSpecifier
Thread storage-class-specifier.
bool isExplicitSpecified() const
void setEnd(SourceLocation e)
Represents a C++ struct/union/class.
static const TSCS TSCS_thread_local
TypeSpecifierWidth
Specifies the width of a type, e.g., short, long, or long long.
static const TST TST_bool
void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc)
Turn this (empty) nested-name-specifier into the global nested-name-specifier '::'.
Defines the clang::TargetInfo interface.
static const TSW TSW_longlong
unsigned getParsedSpecifiers() const
Return a bitmask of which flavors of specifiers this DeclSpec includes.
virtual bool hasFeature(StringRef Feature) const
Determine whether the given target has the given feature.
static const TST TST_atomic
void Extend(ASTContext &Context, SourceLocation TemplateKWLoc, TypeLoc TL, SourceLocation ColonColonLoc)
Extend the current nested-name-specifier by another nested-name-specifier component of the form 'type...
static const TST TST_struct
Annotates a diagnostic with some code that should be inserted, removed, or replaced to fix the proble...
AttributeList * getNext() const
A trivial tuple used to represent a source range.
bool SetTypeSpecComplex(TSC C, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
bool isModulePrivateSpecified() const
Represents a C++ namespace alias.
SourceLocation EndLocation
The location of the last token that describes this unqualified-id.
static const TSCS TSCS__Thread_local
bool isNull() const
isNull - Return true if this QualType doesn't point to a type yet.
enum clang::UnqualifiedId::IdKind Kind
ParsedAttributes & getAttributes()
const DeclSpec & getDeclSpec() const
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
void Clear()
Clear out this builder, and prepare it to build another nested-name-specifier with source-location in...
bool setFunctionSpecInline(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
unsigned isAmbiguous
Can this declaration be a constructor-style initializer?