22 #include "llvm/ADT/SmallPtrSet.h" 23 #include "llvm/ADT/SmallString.h" 48 if (!RD || !RD->getIdentifier() || !RD->getDescribedClassTemplate() ||
61 if (!II || !(II->
isStr(
"__debug") || II->
isStr(
"__profile")) ||
62 !ND->isInStdNamespace())
70 return llvm::StringSwitch<bool>(RD->getIdentifier()->getName())
72 .Case(
"pair", IsInStd)
73 .Case(
"priority_queue", IsInStd)
74 .Case(
"stack", IsInStd)
75 .Case(
"queue", IsInStd)
87 if (Converted.
get()->isValueDependent()) {
95 diag::err_noexcept_needs_constant_expression,
134 if (RT->isRValueReferenceType()) {
138 Diag(Range.
getBegin(), diag::err_rref_in_exception_spec)
151 unsigned DiagID = diag::err_incomplete_in_exception_spec;
152 bool ReturnValueOnError =
true;
154 DiagID = diag::ext_incomplete_in_exception_spec;
155 ReturnValueOnError =
false;
160 return ReturnValueOnError;
191 Diag(Loc, diag::err_exception_spec_not_parsed);
215 Diag(Loc, diag::err_exception_spec_not_parsed);
227 Listener->ResolvedExceptionSpec(FD);
237 bool *MissingExceptionSpecification =
nullptr,
238 bool *MissingEmptyExceptionSpecification =
nullptr,
239 bool AllowNoexceptAllMatchWithNoSpec =
false,
bool IsOperatorNew =
false);
244 if (!isa<CXXDestructorDecl>(Decl) &&
255 return isa<CXXDestructorDecl>(Decl);
270 bool IsOperatorNew = OO == OO_New || OO == OO_Array_New;
271 bool MissingExceptionSpecification =
false;
272 bool MissingEmptyExceptionSpecification =
false;
274 unsigned DiagID = diag::err_mismatched_exception_spec;
275 bool ReturnValueOnError =
true;
277 DiagID = diag::ext_mismatched_exception_spec;
278 ReturnValueOnError =
false;
284 *
this,
PDiag(DiagID),
PDiag(diag::note_previous_declaration),
287 &MissingExceptionSpecification, &MissingEmptyExceptionSpecification,
288 true, IsOperatorNew)) {
305 if (!MissingExceptionSpecification)
306 return ReturnValueOnError;
319 if (MissingEmptyExceptionSpecification && NewProto &&
359 DiagID = diag::ext_ms_missing_exception_specification;
360 ReturnValueOnError =
false;
365 DiagID = diag::ext_missing_exception_specification;
366 ReturnValueOnError =
false;
368 DiagID = diag::err_missing_exception_specification;
369 ReturnValueOnError =
true;
374 llvm::raw_svector_ostream OS(ExceptionSpecString);
382 bool OnFirstException =
true;
383 for (
const auto &E : OldProto->
exceptions()) {
384 if (OnFirstException)
385 OnFirstException =
false;
403 assert(OldProto->
getNoexceptExpr() !=
nullptr &&
"Expected non-null Expr");
409 llvm_unreachable(
"This spec type is compatible with none.");
418 if (!FTLoc.getTypePtr()->hasTrailingReturn())
434 return ReturnValueOnError;
447 unsigned DiagID = diag::err_mismatched_exception_spec;
449 DiagID = diag::ext_mismatched_exception_spec;
451 *
this,
PDiag(DiagID),
PDiag(diag::note_previous_declaration),
452 Old, OldLoc, New, NewLoc);
470 bool *MissingExceptionSpecification,
471 bool *MissingEmptyExceptionSpecification,
472 bool AllowNoexceptAllMatchWithNoSpec,
bool IsOperatorNew) {
473 if (MissingExceptionSpecification)
474 *MissingExceptionSpecification =
false;
476 if (MissingEmptyExceptionSpecification)
477 *MissingEmptyExceptionSpecification =
false;
510 "Shouldn't see unknown exception specifications here");
524 if (!AllowNoexceptAllMatchWithNoSpec &&
537 llvm::FoldingSetNodeID OldFSN, NewFSN;
540 if (OldFSN == NewFSN)
550 llvm::SmallPtrSet<CanQualType, 8> OldTypes, NewTypes;
556 if (OldTypes.count(TypePtr))
557 NewTypes.insert(TypePtr);
564 if (Success && OldTypes.size() == NewTypes.size())
571 if (S.
getLangOpts().CPlusPlus11 && IsOperatorNew) {
574 WithExceptions = New;
576 WithExceptions = Old;
583 if (Name && Name->
getName() ==
"bad_alloc") {
585 if (ExRecord->isInStdNamespace()) {
595 if (MissingExceptionSpecification && OldEST !=
EST_None &&
599 *MissingExceptionSpecification =
true;
601 if (MissingEmptyExceptionSpecification && OldCanThrow ==
CT_Cannot) {
605 *MissingEmptyExceptionSpecification =
true;
611 S.
Diag(NewLoc, DiagID);
613 S.
Diag(OldLoc, NoteID);
706 llvm_unreachable(
"access check dependent for unprivileged context");
708 llvm_unreachable(
"access check delayed in non-declaration");
710 llvm_unreachable(
"unexpected access check result");
746 "Shouldn't see unknown exception specifications here");
769 Diag(SubLoc, DiagID);
771 Diag(SuperLoc, NoteID);
776 "Exception spec subset: non-dynamic case slipped through.");
781 SubI = RefTy->getPointeeType();
784 bool Contained =
false;
798 Diag(SubLoc, DiagID);
800 Diag(SuperLoc, NoteID);
836 auto RetDiag = DiagID;
839 *
this, RetDiag,
PDiag(),
847 "Functions have different argument counts.");
848 for (
unsigned i = 0, E = Target->
getNumParams(); i != E; ++i) {
849 auto ParamDiag = DiagID;
852 *
this, ParamDiag,
PDiag(),
872 unsigned DiagID = diag::err_incompatible_exception_specs;
873 unsigned NestedDiagID = diag::err_deep_exception_specs_differ;
878 DiagID = diag::warn_incompatible_exception_specs;
879 NestedDiagID = diag::warn_deep_exception_specs_differ;
907 if (
getLangOpts().CPlusPlus11 && isa<CXXDestructorDecl>(New)) {
927 unsigned DiagID = diag::err_override_exception_spec;
929 DiagID = diag::ext_override_exception_spec;
931 PDiag(diag::err_deep_exception_specs_differ),
932 PDiag(diag::note_overridden_virtual_function),
952 if (D && isa<FunctionDecl>(D) && D->
hasAttr<NoThrowAttr>())
958 if (S.
getLangOpts().CPlusPlus17 && isa<CallExpr>(E)) {
959 E = cast<CallExpr>(E)->getCallee();
967 if (
auto *Op = dyn_cast<BinaryOperator>(E)) {
968 assert(Op->getOpcode() == BO_PtrMemD || Op->getOpcode() == BO_PtrMemI);
969 T = Op->getRHS()->getType()
972 T = cast<MemberExpr>(E)->getMemberDecl()->getType();
975 }
else if (
const ValueDecl *VD = dyn_cast_or_null<ValueDecl>(D))
1027 if (!cast<CXXRecordDecl>(RT->
getDecl())->isPolymorphic())
1041 case Expr::CXXThrowExprClass:
1045 case Expr::CXXDynamicCastExprClass: {
1054 case Expr::CXXTypeidExprClass:
1062 case Expr::CallExprClass:
1063 case Expr::CXXMemberCallExprClass:
1064 case Expr::CXXOperatorCallExprClass:
1065 case Expr::UserDefinedLiteralClass: {
1066 const CallExpr *CE = cast<CallExpr>(E);
1079 case Expr::CXXConstructExprClass:
1080 case Expr::CXXTemporaryObjectExprClass: {
1082 cast<CXXConstructExpr>(E)->getConstructor());
1088 case Expr::CXXInheritedCtorInitExprClass:
1090 cast<CXXInheritedCtorInitExpr>(E)->getConstructor());
1092 case Expr::LambdaExprClass: {
1093 const LambdaExpr *Lambda = cast<LambdaExpr>(E);
1098 Cap != CapEnd; ++Cap)
1103 case Expr::CXXNewExprClass: {
1108 CT =
canCalleeThrow(*
this, E, cast<CXXNewExpr>(E)->getOperatorNew());
1114 case Expr::CXXDeleteExprClass: {
1116 QualType DTy = cast<CXXDeleteExpr>(E)->getDestroyedType();
1121 cast<CXXDeleteExpr>(E)->getOperatorDelete());
1123 const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
1134 case Expr::CXXBindTemporaryExprClass: {
1137 cast<CXXBindTemporaryExpr>(E)->getTemporary()->getDestructor());
1145 case Expr::ObjCMessageExprClass:
1146 case Expr::ObjCPropertyRefExprClass:
1147 case Expr::ObjCSubscriptRefExprClass:
1153 case Expr::ObjCArrayLiteralClass:
1154 case Expr::ObjCDictionaryLiteralClass:
1155 case Expr::ObjCBoxedExprClass:
1160 case Expr::CoawaitExprClass:
1161 case Expr::ConditionalOperatorClass:
1162 case Expr::CompoundLiteralExprClass:
1163 case Expr::CoyieldExprClass:
1164 case Expr::CXXConstCastExprClass:
1165 case Expr::CXXReinterpretCastExprClass:
1166 case Expr::CXXStdInitializerListExprClass:
1167 case Expr::DesignatedInitExprClass:
1168 case Expr::DesignatedInitUpdateExprClass:
1169 case Expr::ExprWithCleanupsClass:
1170 case Expr::ExtVectorElementExprClass:
1171 case Expr::InitListExprClass:
1172 case Expr::ArrayInitLoopExprClass:
1173 case Expr::MemberExprClass:
1174 case Expr::ObjCIsaExprClass:
1175 case Expr::ObjCIvarRefExprClass:
1176 case Expr::ParenExprClass:
1177 case Expr::ParenListExprClass:
1178 case Expr::ShuffleVectorExprClass:
1179 case Expr::ConvertVectorExprClass:
1180 case Expr::VAArgExprClass:
1184 case Expr::ArraySubscriptExprClass:
1185 case Expr::OMPArraySectionExprClass:
1186 case Expr::BinaryOperatorClass:
1187 case Expr::DependentCoawaitExprClass:
1188 case Expr::CompoundAssignOperatorClass:
1189 case Expr::CStyleCastExprClass:
1190 case Expr::CXXStaticCastExprClass:
1191 case Expr::CXXFunctionalCastExprClass:
1192 case Expr::ImplicitCastExprClass:
1193 case Expr::MaterializeTemporaryExprClass:
1194 case Expr::UnaryOperatorClass: {
1200 case Expr::StmtExprClass:
1203 case Expr::CXXDefaultArgExprClass:
1204 return canThrow(cast<CXXDefaultArgExpr>(E)->getExpr());
1206 case Expr::CXXDefaultInitExprClass:
1207 return canThrow(cast<CXXDefaultInitExpr>(E)->getExpr());
1209 case Expr::ChooseExprClass:
1212 return canThrow(cast<ChooseExpr>(E)->getChosenSubExpr());
1214 case Expr::GenericSelectionExprClass:
1215 if (cast<GenericSelectionExpr>(E)->isResultDependent())
1217 return canThrow(cast<GenericSelectionExpr>(E)->getResultExpr());
1220 case Expr::CXXDependentScopeMemberExprClass:
1221 case Expr::CXXUnresolvedConstructExprClass:
1222 case Expr::DependentScopeDeclRefExprClass:
1223 case Expr::CXXFoldExprClass:
1226 case Expr::AsTypeExprClass:
1227 case Expr::BinaryConditionalOperatorClass:
1228 case Expr::BlockExprClass:
1229 case Expr::CUDAKernelCallExprClass:
1230 case Expr::DeclRefExprClass:
1231 case Expr::ObjCBridgedCastExprClass:
1232 case Expr::ObjCIndirectCopyRestoreExprClass:
1233 case Expr::ObjCProtocolExprClass:
1234 case Expr::ObjCSelectorExprClass:
1235 case Expr::ObjCAvailabilityCheckExprClass:
1236 case Expr::OffsetOfExprClass:
1237 case Expr::PackExpansionExprClass:
1238 case Expr::PseudoObjectExprClass:
1239 case Expr::SubstNonTypeTemplateParmExprClass:
1240 case Expr::SubstNonTypeTemplateParmPackExprClass:
1241 case Expr::FunctionParmPackExprClass:
1242 case Expr::UnaryExprOrTypeTraitExprClass:
1243 case Expr::UnresolvedLookupExprClass:
1244 case Expr::UnresolvedMemberExprClass:
1245 case Expr::TypoExprClass:
1249 case Expr::AddrLabelExprClass:
1250 case Expr::ArrayTypeTraitExprClass:
1251 case Expr::AtomicExprClass:
1252 case Expr::TypeTraitExprClass:
1253 case Expr::CXXBoolLiteralExprClass:
1254 case Expr::CXXNoexceptExprClass:
1255 case Expr::CXXNullPtrLiteralExprClass:
1256 case Expr::CXXPseudoDestructorExprClass:
1257 case Expr::CXXScalarValueInitExprClass:
1258 case Expr::CXXThisExprClass:
1259 case Expr::CXXUuidofExprClass:
1260 case Expr::CharacterLiteralClass:
1261 case Expr::ExpressionTraitExprClass:
1262 case Expr::FloatingLiteralClass:
1263 case Expr::GNUNullExprClass:
1264 case Expr::ImaginaryLiteralClass:
1265 case Expr::ImplicitValueInitExprClass:
1266 case Expr::IntegerLiteralClass:
1267 case Expr::FixedPointLiteralClass:
1268 case Expr::ArrayInitIndexExprClass:
1269 case Expr::NoInitExprClass:
1270 case Expr::ObjCEncodeExprClass:
1271 case Expr::ObjCStringLiteralClass:
1272 case Expr::ObjCBoolLiteralExprClass:
1273 case Expr::OpaqueValueExprClass:
1274 case Expr::PredefinedExprClass:
1275 case Expr::SizeOfPackExprClass:
1276 case Expr::StringLiteralClass:
1280 case Expr::MSPropertyRefExprClass:
1281 case Expr::MSPropertySubscriptExprClass:
1282 llvm_unreachable(
"Invalid class for expression");
1284 #define STMT(CLASS, PARENT) case Expr::CLASS##Class: 1285 #define STMT_RANGE(Base, First, Last) 1286 #define LAST_STMT_RANGE(BASE, FIRST, LAST) 1287 #define EXPR(CLASS, PARENT) 1288 #define ABSTRACT_STMT(STMT) 1289 #include "clang/AST/StmtNodes.inc" 1291 llvm_unreachable(
"Invalid class for expression");
1293 llvm_unreachable(
"Bogus StmtClass");
CanThrowResult canThrow(const Expr *E)
Represents a function declaration or definition.
no exception specification
PointerType - C99 6.7.5.1 - Pointer Declarators.
A (possibly-)qualified type.
bool isMemberPointerType() const
bool CheckExceptionSpecCompatibility(Expr *From, QualType ToType)
void UpdateExceptionSpec(FunctionDecl *FD, const FunctionProtoType::ExceptionSpecInfo &ESI)
unsigned getNumExceptions() const
bool isExternC() const
Determines whether this function is a function with external, C linkage.
void InstantiateExceptionSpec(SourceLocation PointOfInstantiation, FunctionDecl *Function)
const FunctionProtoType * ResolveExceptionSpec(SourceLocation Loc, const FunctionProtoType *FPT)
Stmt - This represents one statement.
ExprResult ActOnNoexceptSpec(SourceLocation NoexceptLoc, Expr *NoexceptExpr, ExceptionSpecificationType &EST)
Check the given noexcept-specifier, convert its expression, and compute the appropriate ExceptionSpec...
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
Defines the SourceManager interface.
bool isRecordType() const
bool isSpecificPlaceholderType(unsigned K) const
Test for a specific placeholder type.
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
Decl - This represents one declaration (or definition), e.g.
bool CheckParamExceptionSpec(const PartialDiagnostic &NestedDiagID, const PartialDiagnostic &NoteID, const FunctionProtoType *Target, SourceLocation TargetLoc, const FunctionProtoType *Source, SourceLocation SourceLoc)
CheckParamExceptionSpec - Check if the parameter and return types of the two functions have equivalen...
Classification Classify(ASTContext &Ctx) const
Classify - Classify this expression according to the C++11 expression taxonomy.
void EvaluateImplicitExceptionSpec(SourceLocation Loc, CXXMethodDecl *MD)
Evaluate the implicit exception specification for a defaulted special member function.
CanQual< T > getUnqualifiedType() const
Retrieve the unqualified form of this type.
Represent a C++ namespace.
SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset=0)
Calls Lexer::getLocForEndOfToken()
A container of type source information.
PartialDiagnostic PDiag(unsigned DiagID=0)
Build a partial diagnostic.
Information about one declarator, including the parsed type information and the identifier.
unsigned getNumParams() const
const T * getAs() const
Member-template getAs<specific type>'.
PrintingPolicy getPrintingPolicy() const
Retrieve a suitable printing policy for diagnostics.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context, bool Canonical) const
Produce a unique representation of the given statement.
unsigned getDiagID() const
Expr * getExprOperand() const
Defines the clang::Expr interface and subclasses for C++ expressions.
noexcept(expression), value-dependent
The collection of all-type qualifiers we support.
Base wrapper for a particular "section" of type source info.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
One of these records is kept for each identifier that is lexed.
bool isStr(const char(&Str)[StrLen]) const
Return true if this is the identifier for the specified string.
ArrayRef< QualType > getParamTypes() const
bool IsDerivedFrom(SourceLocation Loc, QualType Derived, QualType Base)
Determine whether the type Derived is a C++ class that is derived from the type Base.
bool isReferenceType() const
SourceLocation getLocStart() const LLVM_READONLY
bool isReplaceableGlobalAllocationFunction(bool *IsAligned=nullptr) const
Determines whether this function is one of the replaceable global allocation functions: void *operato...
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
bool CheckOverridingFunctionExceptionSpec(const CXXMethodDecl *New, const CXXMethodDecl *Old)
CheckOverridingFunctionExceptionSpec - Checks whether the exception spec is a subset of base spec...
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
bool IsFunctionConversion(QualType FromType, QualType ToType, QualType &ResultTy)
Determine whether the conversion from FromType to ToType is a valid conversion that strips "noexcept"...
bool isVolatileQualified() const
Determine whether this type is volatile-qualified.
static bool CheckSpecForTypesEquivalent(Sema &S, const PartialDiagnostic &DiagID, const PartialDiagnostic &NoteID, QualType Target, SourceLocation TargetLoc, QualType Source, SourceLocation SourceLoc)
Defines the Diagnostic-related interfaces.
void printPretty(raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, const ASTContext *Context=nullptr) const
static bool CheckEquivalentExceptionSpecImpl(Sema &S, const PartialDiagnostic &DiagID, const PartialDiagnostic &NoteID, const FunctionProtoType *Old, SourceLocation OldLoc, const FunctionProtoType *New, SourceLocation NewLoc, bool *MissingExceptionSpecification=nullptr, bool *MissingEmptyExceptionSpecification=nullptr, bool AllowNoexceptAllMatchWithNoSpec=false, bool IsOperatorNew=false)
CheckEquivalentExceptionSpec - Check if the two types have compatible exception specifications.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
const LangOptions & getLangOpts() const
bool isTypeDependent() const
isTypeDependent - Determines whether this expression is type-dependent (C++ [temp.dep.expr]), which means that its type could change from one template instantiation to the next.
CXXDestructorDecl * getDestructor() const
Returns the destructor decl for this class.
IdentifierInfo * getIdentifier() const
QualType getTypeAsWritten() const
getTypeAsWritten - Returns the type that this expression is casting to, as written in the source code...
Sema - This implements semantic analysis and AST building for C.
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
FunctionDecl * getExceptionSpecDecl() const
If this function type has an exception specification which hasn't been determined yet (either because...
Represents a prototype with parameter type info, e.g.
bool compatiblyIncludes(Qualifiers other) const
Determines if these qualifiers compatibly include another set.
CanThrowResult mergeCanThrow(CanThrowResult CT1, CanThrowResult CT2)
OverloadedOperatorKind getCXXOverloadedOperator() const
getCXXOverloadedOperator - If this name is the name of an overloadable operator in C++ (e...
bool isDependentType() const
Whether this declaration declares a type that is dependent, i.e., a type that somehow depends on temp...
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Expr - This represents one expression.
QualType getPointeeType() const
bool isInSystemHeader(SourceLocation Loc) const
Returns if a SourceLocation is in a system header.
const T * castAs() const
Member-template castAs<specific type>.
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
Represents a C++ destructor within a class.
void setInvalidDecl(bool Invalid=true)
setInvalidDecl - Indicates the Decl had a semantic error.
const Expr * getCallee() const
bool isNullPtrType() const
ExprResult VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result, VerifyICEDiagnoser &Diagnoser, bool AllowFold=true)
VerifyIntegerConstantExpression - Verifies that an expression is an ICE, and reports the appropriate ...
ExtProtoInfo withExceptionSpec(const ExceptionSpecInfo &O)
bool RequireCompleteType(SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser)
Ensure that the type T is a complete type.
Defines the clang::TypeLoc interface and its subclasses.
bool handlerCanCatch(QualType HandlerType, QualType ExceptionType)
QualType getFunctionType(QualType ResultTy, ArrayRef< QualType > Args, const FunctionProtoType::ExtProtoInfo &EPI) const
Return a normal function type with a typed argument list.
The result type of a method or function.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
static CanThrowResult canDynamicCastThrow(const CXXDynamicCastExpr *DC)
bool isConstQualified() const
Determine whether this type is const-qualified.
RecordDecl * getDecl() const
noexcept(expression), evals to 'false'
CanThrowResult
Possible results from evaluation of a noexcept expression.
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
ActionResult - This structure is used while parsing/acting on expressions, stmts, etc...
ExceptionSpecificationType Type
The kind of exception specification this is.
TypeLoc IgnoreParens() const
ExtProtoInfo getExtProtoInfo() const
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
Encodes a location in the source.
QualType getReturnType() const
bool CheckDistantExceptionSpec(QualType T)
CheckDistantExceptionSpec - Check if the given type is a pointer or pointer to member to a function w...
CastKind getCastKind() const
SourceLocation getLocStart() const LLVM_READONLY
Represents a static or instance method of a struct/union/class.
bool hasExceptionSpec() const
Return whether this function has any kind of exception spec.
static bool hasImplicitExceptionSpec(FunctionDecl *Decl)
Determine whether a function has an implicitly-generated exception specification. ...
bool isStdNamespace() const
static CanThrowResult canTypeidThrow(Sema &S, const CXXTypeidExpr *DC)
Represents a canonical, potentially-qualified type.
Expr * getNoexceptExpr() const
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
bool isLibstdcxxEagerExceptionSpecHack(const Declarator &D)
Determine if we're in a case where we need to (incorrectly) eagerly parse an exception specification ...
bool hasSameUnqualifiedType(QualType T1, QualType T2) const
Determine whether the given types are equivalent after cvr-qualifiers have been removed.
ExceptionSpecificationType getExceptionSpecType() const
Get the kind of exception specification on this function.
QualType getArrayDecayedType(QualType T) const
Return the properly qualified result of decaying the specified array type to a pointer.
exception_iterator exception_begin() const
StringRef getName() const
Return the actual identifier string.
bool isTypeOperand() const
Dataflow Directional Tag Classes.
bool isValid() const
Return true if this is a valid SourceLocation object.
not evaluated yet, for special member function
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
ASTMutationListener * getASTMutationListener() const
bool hasDependentExceptionSpec() const
Return whether this function has a dependent exception spec.
StmtClass getStmtClass() const
ArrayRef< QualType > exceptions() const
const CXXRecordDecl * getParent() const
Returns the parent of this method declaration, which is the class in which this method is defined...
bool isAmbiguous(CanQualType BaseType)
Determine whether the path from the most-derived type to the given base type is ambiguous (i...
A pointer to member type per C++ 8.3.3 - Pointers to members.
Expr * IgnoreParenImpCasts() LLVM_READONLY
IgnoreParenImpCasts - Ignore parentheses and implicit casts.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
CanThrowResult canThrow() const
Determine whether this function type has a non-throwing exception specification.
bool CheckExceptionSpecSubset(const PartialDiagnostic &DiagID, const PartialDiagnostic &NestedDiagID, const PartialDiagnostic &NoteID, const FunctionProtoType *Superset, SourceLocation SuperLoc, const FunctionProtoType *Subset, SourceLocation SubLoc)
CheckExceptionSpecSubset - Check whether the second function type's exception specification is a subs...
bool isFunctionType() const
TypeSourceInfo * getTypeSourceInfo() const
Base for LValueReferenceType and RValueReferenceType.
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
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.
bool isObjectType() const
Determine whether this type is an object type.
SourceManager & getSourceManager()
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
QualType getParamType(unsigned i) const
Represents a C++ struct/union/class.
unsigned getBuiltinID() const
Returns a value indicating whether this function corresponds to a builtin function.
bool CheckSpecifiedExceptionType(QualType &T, SourceRange Range)
CheckSpecifiedExceptionType - Check if the given type is valid in an exception specification.
AccessResult CheckBaseClassAccess(SourceLocation AccessLoc, QualType Base, QualType Derived, const CXXBasePath &Path, unsigned DiagID, bool ForceCheck=false, bool ForceUnprivileged=false)
Checks access for a hierarchy conversion.
DeclContext * CurContext
CurContext - This is the current declaration context of parsing.
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
void adjustExceptionSpec(FunctionDecl *FD, const FunctionProtoType::ExceptionSpecInfo &ESI, bool AsWritten=false)
Change the exception specification on a function once it is delay-parsed, instantiated, or computed.
static CanThrowResult canCalleeThrow(Sema &S, const Expr *E, const Decl *D)
bool IsQualificationConversion(QualType FromType, QualType ToType, bool CStyle, bool &ObjCLifetimeConversion)
IsQualificationConversion - Determines whether the conversion from an rvalue of type FromType to ToTy...
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression...
Expr *const * const_capture_init_iterator
Const iterator that walks over the capture initialization arguments.
bool isPointerType() const
BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases...
bool isUnresolvedExceptionSpec(ExceptionSpecificationType ESpecType)
A trivial tuple used to represent a source range.
ExprResult CheckBooleanCondition(SourceLocation Loc, Expr *E, bool IsConstexpr=false)
CheckBooleanCondition - Diagnose problems involving the use of the given expression as a boolean cond...
static CanThrowResult canSubExprsThrow(Sema &S, const Expr *E)
SmallVector< std::pair< const CXXMethodDecl *, const CXXMethodDecl * >, 2 > DelayedExceptionSpecChecks
All the overriding functions seen during a class definition that had their exception spec checks dela...
bool CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New)
void setType(QualType newType)
SourceLocation getBegin() const
static const FunctionProtoType * GetUnderlyingFunction(QualType T)
QualType getUnqualifiedArrayType(QualType T, Qualifiers &Quals)
Return this type as a completely-unqualified array type, capturing the qualifiers in Quals...
SourceLocation getLocation() const
QualType getType() const
Return the type wrapped by this type source info.
bool isBeingDefined() const
Return true if this decl is currently being defined.
noexcept(expression), evals to 'true'
Expr * IgnoreParens() LLVM_READONLY
IgnoreParens - Ignore parentheses.