22 #include "llvm/ADT/SmallPtrSet.h"
23 #include "llvm/ADT/SmallString.h"
56 return llvm::StringSwitch<bool>(RD->getIdentifier()->getName())
59 .Case(
"priority_queue",
true)
97 if (RT->isRValueReferenceType()) {
101 Diag(Range.
getBegin(), diag::err_rref_in_exception_spec)
114 unsigned DiagID = diag::err_incomplete_in_exception_spec;
115 bool ReturnValueOnError =
true;
117 DiagID = diag::ext_incomplete_in_exception_spec;
118 ReturnValueOnError =
false;
123 return ReturnValueOnError;
149 Diag(Loc, diag::err_exception_spec_not_parsed);
173 Diag(Loc, diag::err_exception_spec_not_parsed);
185 Listener->ResolvedExceptionSpec(FD);
187 for (
auto *Redecl : FD->
redecls())
194 if (!isa<CXXDestructorDecl>(Decl) &&
205 return isa<CXXDestructorDecl>(Decl);
214 bool IsOperatorNew = OO == OO_New || OO == OO_Array_New;
215 bool MissingExceptionSpecification =
false;
216 bool MissingEmptyExceptionSpecification =
false;
218 unsigned DiagID = diag::err_mismatched_exception_spec;
219 bool ReturnValueOnError =
true;
221 DiagID = diag::ext_mismatched_exception_spec;
222 ReturnValueOnError =
false;
228 PDiag(DiagID),
PDiag(diag::note_previous_declaration),
231 &MissingExceptionSpecification, &MissingEmptyExceptionSpecification,
232 true, IsOperatorNew)) {
239 Diag(New->getLocation(), diag::ext_implicit_exception_spec_mismatch)
241 if (Old->getLocation().isValid())
242 Diag(Old->getLocation(), diag::note_previous_declaration);
249 if (!MissingExceptionSpecification)
250 return ReturnValueOnError;
263 if (MissingEmptyExceptionSpecification && NewProto &&
264 (Old->getLocation().isInvalid() ||
285 New->setInvalidDecl();
296 DiagID = diag::ext_ms_missing_exception_specification;
297 ReturnValueOnError =
false;
302 DiagID = diag::ext_missing_exception_specification;
303 ReturnValueOnError =
false;
305 DiagID = diag::err_missing_exception_specification;
306 ReturnValueOnError =
true;
311 llvm::raw_svector_ostream OS(ExceptionSpecString);
319 bool OnFirstException =
true;
321 if (OnFirstException)
322 OnFirstException =
false;
338 assert(OldProto->
getNoexceptExpr() !=
nullptr &&
"Expected non-null Expr");
344 llvm_unreachable(
"This spec type is compatible with none.");
353 if (!FTLoc.getTypePtr()->hasTrailingReturn())
358 Diag(New->getLocation(), DiagID)
361 Diag(New->getLocation(), DiagID)
366 if (Old->getLocation().isValid())
367 Diag(Old->getLocation(), diag::note_previous_declaration);
369 return ReturnValueOnError;
379 unsigned DiagID = diag::err_mismatched_exception_spec;
381 DiagID = diag::ext_mismatched_exception_spec;
383 PDiag(diag::note_previous_declaration), Old, OldLoc, New, NewLoc);
403 bool *MissingExceptionSpecification,
404 bool*MissingEmptyExceptionSpecification,
405 bool AllowNoexceptAllMatchWithNoSpec,
406 bool IsOperatorNew) {
411 if (MissingExceptionSpecification)
412 *MissingExceptionSpecification =
false;
414 if (MissingEmptyExceptionSpecification)
415 *MissingEmptyExceptionSpecification =
false;
448 "Shouldn't see unknown exception specifications here");
463 if (OldNR == NewNR &&
467 if (OldNR != NewNR &&
470 Diag(NewLoc, DiagID);
472 Diag(OldLoc, NoteID);
492 if (AllowNoexceptAllMatchWithNoSpec) {
504 if (OldNonThrowing && NewNonThrowing)
513 WithExceptions = New;
515 WithExceptions = Old;
522 if (Name && Name->
getName() ==
"bad_alloc") {
524 if (ExRecord->isInStdNamespace()) {
539 *MissingExceptionSpecification =
true;
541 if (MissingEmptyExceptionSpecification && OldNonThrowing) {
545 *MissingEmptyExceptionSpecification =
true;
551 Diag(NewLoc, DiagID);
553 Diag(OldLoc, NoteID);
558 "Exception compatibility logic error: non-dynamic spec slipped through.");
563 llvm::SmallPtrSet<CanQualType, 8> OldTypes, NewTypes;
569 if(OldTypes.count(TypePtr))
570 NewTypes.insert(TypePtr);
575 Success = Success && OldTypes.size() == NewTypes.size();
580 Diag(NewLoc, DiagID);
582 Diag(OldLoc, NoteID);
637 "Shouldn't see unknown exception specifications here");
641 Diag(SubLoc, DiagID);
643 Diag(SuperLoc, NoteID);
654 Diag(SubLoc, DiagID);
656 Diag(SuperLoc, NoteID);
666 Diag(SubLoc, DiagID);
668 Diag(SuperLoc, NoteID);
673 "Exception spec subset: non-dynamic case slipped through.");
676 for (
const auto &SubI : Subset->
exceptions()) {
682 bool SubIsPointer =
false;
695 bool Contained =
false;
697 for (
const auto &SuperI : Superset->
exceptions()) {
712 if (CanonicalSubT == CanonicalSuperT) {
722 if (!
IsDerivedFrom(SubLoc, CanonicalSubT, CanonicalSuperT, Paths))
730 CanonicalSuperT, CanonicalSubT,
738 llvm_unreachable(
"access check dependent for unprivileged context");
740 llvm_unreachable(
"access check delayed in non-declaration");
747 Diag(SubLoc, DiagID);
749 Diag(SuperLoc, NoteID);
784 *
this,
PDiag(diag::err_deep_exception_specs_differ) << 0,
PDiag(),
792 "Functions have different argument counts.");
795 *
this,
PDiag(diag::err_deep_exception_specs_differ) << 1,
PDiag(),
829 From->getSourceRange().getBegin(),
840 if (
getLangOpts().CPlusPlus11 && isa<CXXDestructorDecl>(New)) {
860 unsigned DiagID = diag::err_override_exception_spec;
862 DiagID = diag::ext_override_exception_spec;
864 PDiag(diag::note_overridden_virtual_function),
873 for (
const Stmt *SubStmt : E->children()) {
882 assert(D &&
"Expected decl");
891 if (isa<FunctionDecl>(D) && D->hasAttr<NoThrowAttr>())
941 if (!cast<CXXRecordDecl>(RT->
getDecl())->isPolymorphic())
954 switch (E->getStmtClass()) {
955 case Expr::CXXThrowExprClass:
959 case Expr::CXXDynamicCastExprClass: {
968 case Expr::CXXTypeidExprClass:
976 case Expr::CallExprClass:
977 case Expr::CXXMemberCallExprClass:
978 case Expr::CXXOperatorCallExprClass:
979 case Expr::UserDefinedLiteralClass: {
995 case Expr::CXXConstructExprClass:
996 case Expr::CXXTemporaryObjectExprClass: {
998 cast<CXXConstructExpr>(E)->getConstructor());
1004 case Expr::CXXInheritedCtorInitExprClass:
1006 cast<CXXInheritedCtorInitExpr>(E)->getConstructor());
1008 case Expr::LambdaExprClass: {
1014 Cap != CapEnd; ++Cap)
1019 case Expr::CXXNewExprClass: {
1024 CT =
canCalleeThrow(*
this, E, cast<CXXNewExpr>(E)->getOperatorNew());
1030 case Expr::CXXDeleteExprClass: {
1032 QualType DTy = cast<CXXDeleteExpr>(
E)->getDestroyedType();
1037 cast<CXXDeleteExpr>(E)->getOperatorDelete());
1039 const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
1050 case Expr::CXXBindTemporaryExprClass: {
1053 cast<CXXBindTemporaryExpr>(E)->getTemporary()->getDestructor());
1061 case Expr::ObjCMessageExprClass:
1062 case Expr::ObjCPropertyRefExprClass:
1063 case Expr::ObjCSubscriptRefExprClass:
1069 case Expr::ObjCArrayLiteralClass:
1070 case Expr::ObjCDictionaryLiteralClass:
1071 case Expr::ObjCBoxedExprClass:
1076 case Expr::CoawaitExprClass:
1077 case Expr::ConditionalOperatorClass:
1078 case Expr::CompoundLiteralExprClass:
1079 case Expr::CoyieldExprClass:
1080 case Expr::CXXConstCastExprClass:
1081 case Expr::CXXReinterpretCastExprClass:
1082 case Expr::CXXStdInitializerListExprClass:
1083 case Expr::DesignatedInitExprClass:
1084 case Expr::DesignatedInitUpdateExprClass:
1085 case Expr::ExprWithCleanupsClass:
1086 case Expr::ExtVectorElementExprClass:
1087 case Expr::InitListExprClass:
1088 case Expr::MemberExprClass:
1089 case Expr::ObjCIsaExprClass:
1090 case Expr::ObjCIvarRefExprClass:
1091 case Expr::ParenExprClass:
1092 case Expr::ParenListExprClass:
1093 case Expr::ShuffleVectorExprClass:
1094 case Expr::ConvertVectorExprClass:
1095 case Expr::VAArgExprClass:
1099 case Expr::ArraySubscriptExprClass:
1100 case Expr::OMPArraySectionExprClass:
1101 case Expr::BinaryOperatorClass:
1102 case Expr::CompoundAssignOperatorClass:
1103 case Expr::CStyleCastExprClass:
1104 case Expr::CXXStaticCastExprClass:
1105 case Expr::CXXFunctionalCastExprClass:
1106 case Expr::ImplicitCastExprClass:
1107 case Expr::MaterializeTemporaryExprClass:
1108 case Expr::UnaryOperatorClass: {
1114 case Expr::StmtExprClass:
1117 case Expr::CXXDefaultArgExprClass:
1118 return canThrow(cast<CXXDefaultArgExpr>(E)->getExpr());
1120 case Expr::CXXDefaultInitExprClass:
1121 return canThrow(cast<CXXDefaultInitExpr>(E)->getExpr());
1123 case Expr::ChooseExprClass:
1126 return canThrow(cast<ChooseExpr>(E)->getChosenSubExpr());
1128 case Expr::GenericSelectionExprClass:
1129 if (cast<GenericSelectionExpr>(E)->isResultDependent())
1131 return canThrow(cast<GenericSelectionExpr>(E)->getResultExpr());
1134 case Expr::CXXDependentScopeMemberExprClass:
1135 case Expr::CXXUnresolvedConstructExprClass:
1136 case Expr::DependentScopeDeclRefExprClass:
1137 case Expr::CXXFoldExprClass:
1140 case Expr::AsTypeExprClass:
1141 case Expr::BinaryConditionalOperatorClass:
1142 case Expr::BlockExprClass:
1143 case Expr::CUDAKernelCallExprClass:
1144 case Expr::DeclRefExprClass:
1145 case Expr::ObjCBridgedCastExprClass:
1146 case Expr::ObjCIndirectCopyRestoreExprClass:
1147 case Expr::ObjCProtocolExprClass:
1148 case Expr::ObjCSelectorExprClass:
1149 case Expr::ObjCAvailabilityCheckExprClass:
1150 case Expr::OffsetOfExprClass:
1151 case Expr::PackExpansionExprClass:
1152 case Expr::PseudoObjectExprClass:
1153 case Expr::SubstNonTypeTemplateParmExprClass:
1154 case Expr::SubstNonTypeTemplateParmPackExprClass:
1155 case Expr::FunctionParmPackExprClass:
1156 case Expr::UnaryExprOrTypeTraitExprClass:
1157 case Expr::UnresolvedLookupExprClass:
1158 case Expr::UnresolvedMemberExprClass:
1159 case Expr::TypoExprClass:
1163 case Expr::AddrLabelExprClass:
1164 case Expr::ArrayTypeTraitExprClass:
1165 case Expr::AtomicExprClass:
1166 case Expr::TypeTraitExprClass:
1167 case Expr::CXXBoolLiteralExprClass:
1168 case Expr::CXXNoexceptExprClass:
1169 case Expr::CXXNullPtrLiteralExprClass:
1170 case Expr::CXXPseudoDestructorExprClass:
1171 case Expr::CXXScalarValueInitExprClass:
1172 case Expr::CXXThisExprClass:
1173 case Expr::CXXUuidofExprClass:
1174 case Expr::CharacterLiteralClass:
1175 case Expr::ExpressionTraitExprClass:
1176 case Expr::FloatingLiteralClass:
1177 case Expr::GNUNullExprClass:
1178 case Expr::ImaginaryLiteralClass:
1179 case Expr::ImplicitValueInitExprClass:
1180 case Expr::IntegerLiteralClass:
1181 case Expr::NoInitExprClass:
1182 case Expr::ObjCEncodeExprClass:
1183 case Expr::ObjCStringLiteralClass:
1184 case Expr::ObjCBoolLiteralExprClass:
1185 case Expr::OpaqueValueExprClass:
1186 case Expr::PredefinedExprClass:
1187 case Expr::SizeOfPackExprClass:
1188 case Expr::StringLiteralClass:
1192 case Expr::MSPropertyRefExprClass:
1193 case Expr::MSPropertySubscriptExprClass:
1194 llvm_unreachable(
"Invalid class for expression");
1196 #define STMT(CLASS, PARENT) case Expr::CLASS##Class:
1197 #define STMT_RANGE(Base, First, Last)
1198 #define LAST_STMT_RANGE(BASE, FIRST, LAST)
1199 #define EXPR(CLASS, PARENT)
1200 #define ABSTRACT_STMT(STMT)
1201 #include "clang/AST/StmtNodes.inc"
1202 case Expr::NoStmtClass:
1203 llvm_unreachable(
"Invalid class for expression");
1205 llvm_unreachable(
"Bogus StmtClass");
CanThrowResult canThrow(const Expr *E)
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
CastKind getCastKind() const
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
no exception specification
PointerType - C99 6.7.5.1 - Pointer Declarators.
A (possibly-)qualified type.
bool CheckExceptionSpecCompatibility(Expr *From, QualType ToType)
bool isReplaceableGlobalAllocationFunction() const
Determines whether this function is one of the replaceable global allocation functions: void *operato...
void UpdateExceptionSpec(FunctionDecl *FD, const FunctionProtoType::ExceptionSpecInfo &ESI)
void InstantiateExceptionSpec(SourceLocation PointOfInstantiation, FunctionDecl *Function)
FunctionDecl * getExceptionSpecDecl() const
If this function type has an exception specification which hasn't been determined yet (either because...
const FunctionProtoType * ResolveExceptionSpec(SourceLocation Loc, const FunctionProtoType *FPT)
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
const LangOptions & getLangOpts() const
CanQual< T > getUnqualifiedType() const
Retrieve the unqualified form of this type.
Defines the SourceManager interface.
bool isRecordType() const
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
void EvaluateImplicitExceptionSpec(SourceLocation Loc, CXXMethodDecl *MD)
Evaluate the implicit exception specification for a defaulted special member function.
SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset=0)
Calls Lexer::getLocForEndOfToken()
A container of type source information.
Expr *const * const_capture_init_iterator
Const iterator that walks over the capture initialization arguments.
PartialDiagnostic PDiag(unsigned DiagID=0)
Build a partial diagnostic.
The noexcept specifier has a bad expression.
Information about one declarator, including the parsed type information and the identifier.
const Expr * getCallee() const
void clear()
Clear the base-paths results.
Defines the clang::Expr interface and subclasses for C++ expressions.
QualType getArrayDecayedType(QualType T) const
Return the properly qualified result of decaying the specified array type to a pointer.
Base wrapper for a particular "section" of type source info.
unsigned getNumParams() const
bool isExternC() const
Determines whether this function is a function with external, C linkage.
One of these records is kept for each identifier that is lexed.
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
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
NoexceptResult
Result type of getNoexceptSpec().
SourceLocation getLocStart() const LLVM_READONLY
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Microsoft throw(...) extension.
unsigned getDiagID() const
QualType getReturnType() const
const CXXRecordDecl * getParent() const
Returns the parent of this method declaration, which is the class in which this method is defined...
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...
Expr * getExprOperand() const
Expr * getNoexceptExpr() const
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
RecordDecl * getDecl() const
static bool CheckSpecForTypesEquivalent(Sema &S, const PartialDiagnostic &DiagID, const PartialDiagnostic &NoteID, QualType Target, SourceLocation TargetLoc, QualType Source, SourceLocation SourceLoc)
QualType getTypeAsWritten() const
getTypeAsWritten - Returns the type that this expression is casting to, as written in the source code...
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
detail::InMemoryDirectory::const_iterator I
Sema - This implements semantic analysis and AST building for C.
QualType getParamType(unsigned i) const
Represents a prototype with parameter type info, e.g.
ExceptionSpecificationType getExceptionSpecType() const
Get the kind of exception specification on this function.
CanThrowResult mergeCanThrow(CanThrowResult CT1, CanThrowResult CT2)
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
StringRef getName() const
Return the actual identifier string.
Represents a C++ destructor within a class.
ExtProtoInfo getExtProtoInfo() const
ExtProtoInfo withExceptionSpec(const ExceptionSpecInfo &O)
Classification Classify(ASTContext &Ctx) const
Classify - Classify this expression according to the C++11 expression taxonomy.
bool isInSystemHeader(SourceLocation Loc) const
Returns if a SourceLocation is in a system header.
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.
There is no noexcept specifier.
ASTMutationListener * getASTMutationListener() const
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
The result type of a method or function.
TypeSourceInfo * getTypeSourceInfo() const
static CanThrowResult canDynamicCastThrow(const CXXDynamicCastExpr *DC)
bool isNothrow(const ASTContext &Ctx, bool ResultIfDependent=false) const
Determine whether this function type has a non-throwing exception specification.
CanThrowResult
Possible results from evaluation of a noexcept expression.
exception_iterator exception_begin() const
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
ExceptionSpecificationType Type
The kind of exception specification this is.
Encodes a location in the source.
bool CheckDistantExceptionSpec(QualType T)
CheckDistantExceptionSpec - Check if the given type is a pointer or pointer to member to a function w...
bool isValid() const
Return true if this is a valid SourceLocation object.
OverloadedOperatorKind getCXXOverloadedOperator() const
getCXXOverloadedOperator - If this name is the name of an overloadable operator in C++ (e...
Represents a static or instance method of a struct/union/class.
static bool hasImplicitExceptionSpec(FunctionDecl *Decl)
Determine whether a function has an implicitly-generated exception specification. ...
The noexcept specifier evaluates to true.
static CanThrowResult canTypeidThrow(Sema &S, const CXXTypeidExpr *DC)
bool hasDependentExceptionSpec() const
Return whether this function has a dependent exception spec.
SourceLocation getBegin() 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.
const T * castAs() const
Member-template castAs<specific type>.
NoexceptResult getNoexceptSpec(const ASTContext &Ctx) const
Get the meaning of the noexcept spec on this function, if any.
bool isLibstdcxxEagerExceptionSpecHack(const Declarator &D)
Determine if we're in a case where we need to (incorrectly) eagerly parse an exception specification ...
bool isDependentType() const
Whether this declaration declares a type that is dependent, i.e., a type that somehow depends on temp...
QualType getType() const
Return the type wrapped by this type source info.
QualType getFunctionType(QualType ResultTy, ArrayRef< QualType > Args, const FunctionProtoType::ExtProtoInfo &EPI) const
Return a normal function type with a typed argument list.
bool isStr(const char(&Str)[StrLen]) const
Return true if this is the identifier for the specified string.
not evaluated yet, for special member function
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
CXXDestructorDecl * getDestructor() const
Returns the destructor decl for this class.
TypeLoc IgnoreParens() const
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
detail::InMemoryDirectory::const_iterator E
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.
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
Defines the Diagnostic-related interfaces.
QualType getLocalUnqualifiedType() const
Return this type with all of the instance-specific qualifiers removed, but without removing any quali...
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
const T * getAs() const
Member-template getAs<specific type>'.
PrintingPolicy getPrintingPolicy() const
Retrieve a suitable printing policy.
bool CheckExceptionSpecSubset(const PartialDiagnostic &DiagID, 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
The noexcept specifier evaluates to false.
Base for LValueReferenceType and RValueReferenceType.
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
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.
SourceManager & getSourceManager()
IdentifierInfo * getIdentifier() const
bool CheckParamExceptionSpec(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...
Represents a C++ struct/union/class.
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.
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)
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression...
BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases...
bool hasExceptionSpec() const
Return whether this function has any kind of exception spec.
bool isUnresolvedExceptionSpec(ExceptionSpecificationType ESpecType)
A trivial tuple used to represent a source range.
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 isNull() const
Return true if this QualType doesn't point to a type yet.
bool isTypeOperand() const
The noexcept specifier is dependent.
bool CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New)
NamespaceDecl * getStdNamespace() const
void setType(QualType newType)
ArrayRef< QualType > exceptions() const
bool isBeingDefined() const
isBeingDefined - Return true if this decl is currently being defined.
static const FunctionProtoType * GetUnderlyingFunction(QualType T)
Expr * IgnoreParens() LLVM_READONLY
IgnoreParens - Ignore parentheses.
unsigned getNumExceptions() const