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)
111 if (RT->isRValueReferenceType()) {
115 Diag(Range.
getBegin(), diag::err_rref_in_exception_spec)
128 unsigned DiagID = diag::err_incomplete_in_exception_spec;
129 bool ReturnValueOnError =
true;
131 DiagID = diag::ext_incomplete_in_exception_spec;
132 ReturnValueOnError =
false;
137 return ReturnValueOnError;
168 Diag(Loc, diag::err_exception_spec_not_parsed);
192 Diag(Loc, diag::err_exception_spec_not_parsed);
204 Listener->ResolvedExceptionSpec(FD);
206 for (
auto *Redecl : FD->
redecls())
214 bool *MissingExceptionSpecification =
nullptr,
215 bool *MissingEmptyExceptionSpecification =
nullptr,
216 bool AllowNoexceptAllMatchWithNoSpec =
false,
bool IsOperatorNew =
false);
221 if (!isa<CXXDestructorDecl>(Decl) &&
232 return isa<CXXDestructorDecl>(Decl);
247 bool IsOperatorNew = OO == OO_New || OO == OO_Array_New;
248 bool MissingExceptionSpecification =
false;
249 bool MissingEmptyExceptionSpecification =
false;
251 unsigned DiagID = diag::err_mismatched_exception_spec;
252 bool ReturnValueOnError =
true;
254 DiagID = diag::ext_mismatched_exception_spec;
255 ReturnValueOnError =
false;
261 *
this,
PDiag(DiagID),
PDiag(diag::note_previous_declaration),
264 &MissingExceptionSpecification, &MissingEmptyExceptionSpecification,
265 true, IsOperatorNew)) {
282 if (!MissingExceptionSpecification)
283 return ReturnValueOnError;
296 if (MissingEmptyExceptionSpecification && NewProto &&
330 DiagID = diag::ext_ms_missing_exception_specification;
331 ReturnValueOnError =
false;
336 DiagID = diag::ext_missing_exception_specification;
337 ReturnValueOnError =
false;
339 DiagID = diag::err_missing_exception_specification;
340 ReturnValueOnError =
true;
345 llvm::raw_svector_ostream OS(ExceptionSpecString);
353 bool OnFirstException =
true;
354 for (
const auto &E : OldProto->
exceptions()) {
355 if (OnFirstException)
356 OnFirstException =
false;
372 assert(OldProto->
getNoexceptExpr() !=
nullptr &&
"Expected non-null Expr");
378 llvm_unreachable(
"This spec type is compatible with none.");
387 if (!FTLoc.getTypePtr()->hasTrailingReturn())
403 return ReturnValueOnError;
416 unsigned DiagID = diag::err_mismatched_exception_spec;
418 DiagID = diag::ext_mismatched_exception_spec;
420 *
this,
PDiag(DiagID),
PDiag(diag::note_previous_declaration),
421 Old, OldLoc, New, NewLoc);
439 bool *MissingExceptionSpecification,
440 bool *MissingEmptyExceptionSpecification,
441 bool AllowNoexceptAllMatchWithNoSpec,
bool IsOperatorNew) {
442 if (MissingExceptionSpecification)
443 *MissingExceptionSpecification =
false;
445 if (MissingEmptyExceptionSpecification)
446 *MissingEmptyExceptionSpecification =
false;
479 "Shouldn't see unknown exception specifications here");
494 if (OldNR == NewNR &&
498 if (OldNR != NewNR &&
501 S.
Diag(NewLoc, DiagID);
503 S.
Diag(OldLoc, NoteID);
523 if (AllowNoexceptAllMatchWithNoSpec) {
535 if (OldNonThrowing && NewNonThrowing)
541 if (S.
getLangOpts().CPlusPlus11 && IsOperatorNew) {
544 WithExceptions = New;
546 WithExceptions = Old;
553 if (Name && Name->
getName() ==
"bad_alloc") {
555 if (ExRecord->isInStdNamespace()) {
570 *MissingExceptionSpecification =
true;
572 if (MissingEmptyExceptionSpecification && OldNonThrowing) {
576 *MissingEmptyExceptionSpecification =
true;
582 S.
Diag(NewLoc, DiagID);
584 S.
Diag(OldLoc, NoteID);
589 "Exception compatibility logic error: non-dynamic spec slipped through.");
594 llvm::SmallPtrSet<CanQualType, 8> OldTypes, NewTypes;
600 if (OldTypes.count(TypePtr))
601 NewTypes.insert(TypePtr);
606 Success = Success && OldTypes.size() == NewTypes.size();
611 S.
Diag(NewLoc, DiagID);
613 S.
Diag(OldLoc, NoteID);
685 "Shouldn't see unknown exception specifications here");
689 Diag(SubLoc, DiagID);
691 Diag(SuperLoc, NoteID);
702 Diag(SubLoc, DiagID);
704 Diag(SuperLoc, NoteID);
715 Diag(SubLoc, DiagID);
717 Diag(SuperLoc, NoteID);
722 "Exception spec subset: non-dynamic case slipped through.");
725 for (
const auto &SubI : Subset->
exceptions()) {
731 bool SubIsPointer =
false;
744 bool Contained =
false;
746 for (
const auto &SuperI : Superset->
exceptions()) {
761 if (CanonicalSubT == CanonicalSuperT) {
771 if (!
IsDerivedFrom(SubLoc, CanonicalSubT, CanonicalSuperT, Paths))
779 CanonicalSuperT, CanonicalSubT,
787 llvm_unreachable(
"access check dependent for unprivileged context");
789 llvm_unreachable(
"access check delayed in non-declaration");
796 Diag(SubLoc, DiagID);
798 Diag(SuperLoc, NoteID);
834 auto RetDiag = DiagID;
837 *
this, RetDiag,
PDiag(),
845 "Functions have different argument counts.");
846 for (
unsigned i = 0, E = Target->
getNumParams(); i != E; ++i) {
847 auto ParamDiag = DiagID;
850 *
this, ParamDiag,
PDiag(),
870 unsigned DiagID = diag::err_incompatible_exception_specs;
871 unsigned NestedDiagID = diag::err_deep_exception_specs_differ;
876 DiagID = diag::warn_incompatible_exception_specs;
877 NestedDiagID = diag::warn_deep_exception_specs_differ;
905 if (
getLangOpts().CPlusPlus11 && isa<CXXDestructorDecl>(New)) {
925 unsigned DiagID = diag::err_override_exception_spec;
927 DiagID = diag::ext_override_exception_spec;
929 PDiag(diag::err_deep_exception_specs_differ),
930 PDiag(diag::note_overridden_virtual_function),
950 if (D && isa<FunctionDecl>(D) && D->
hasAttr<NoThrowAttr>())
956 if (S.
getLangOpts().CPlusPlus17 && isa<CallExpr>(E)) {
957 E = cast<CallExpr>(E)->getCallee();
965 if (
auto *Op = dyn_cast<BinaryOperator>(E)) {
966 assert(Op->getOpcode() == BO_PtrMemD || Op->getOpcode() == BO_PtrMemI);
967 T = Op->getRHS()->getType()
970 T = cast<MemberExpr>(E)->getMemberDecl()->getType();
973 }
else if (
const ValueDecl *VD = dyn_cast_or_null<ValueDecl>(D))
1025 if (!cast<CXXRecordDecl>(RT->
getDecl())->isPolymorphic())
1039 case Expr::CXXThrowExprClass:
1043 case Expr::CXXDynamicCastExprClass: {
1052 case Expr::CXXTypeidExprClass:
1060 case Expr::CallExprClass:
1061 case Expr::CXXMemberCallExprClass:
1062 case Expr::CXXOperatorCallExprClass:
1063 case Expr::UserDefinedLiteralClass: {
1064 const CallExpr *CE = cast<CallExpr>(E);
1077 case Expr::CXXConstructExprClass:
1078 case Expr::CXXTemporaryObjectExprClass: {
1080 cast<CXXConstructExpr>(E)->getConstructor());
1086 case Expr::CXXInheritedCtorInitExprClass:
1088 cast<CXXInheritedCtorInitExpr>(E)->getConstructor());
1090 case Expr::LambdaExprClass: {
1091 const LambdaExpr *Lambda = cast<LambdaExpr>(E);
1096 Cap != CapEnd; ++Cap)
1101 case Expr::CXXNewExprClass: {
1106 CT =
canCalleeThrow(*
this, E, cast<CXXNewExpr>(E)->getOperatorNew());
1112 case Expr::CXXDeleteExprClass: {
1114 QualType DTy = cast<CXXDeleteExpr>(E)->getDestroyedType();
1119 cast<CXXDeleteExpr>(E)->getOperatorDelete());
1121 const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
1132 case Expr::CXXBindTemporaryExprClass: {
1135 cast<CXXBindTemporaryExpr>(E)->getTemporary()->getDestructor());
1143 case Expr::ObjCMessageExprClass:
1144 case Expr::ObjCPropertyRefExprClass:
1145 case Expr::ObjCSubscriptRefExprClass:
1151 case Expr::ObjCArrayLiteralClass:
1152 case Expr::ObjCDictionaryLiteralClass:
1153 case Expr::ObjCBoxedExprClass:
1158 case Expr::CoawaitExprClass:
1159 case Expr::ConditionalOperatorClass:
1160 case Expr::CompoundLiteralExprClass:
1161 case Expr::CoyieldExprClass:
1162 case Expr::CXXConstCastExprClass:
1163 case Expr::CXXReinterpretCastExprClass:
1164 case Expr::CXXStdInitializerListExprClass:
1165 case Expr::DesignatedInitExprClass:
1166 case Expr::DesignatedInitUpdateExprClass:
1167 case Expr::ExprWithCleanupsClass:
1168 case Expr::ExtVectorElementExprClass:
1169 case Expr::InitListExprClass:
1170 case Expr::ArrayInitLoopExprClass:
1171 case Expr::MemberExprClass:
1172 case Expr::ObjCIsaExprClass:
1173 case Expr::ObjCIvarRefExprClass:
1174 case Expr::ParenExprClass:
1175 case Expr::ParenListExprClass:
1176 case Expr::ShuffleVectorExprClass:
1177 case Expr::ConvertVectorExprClass:
1178 case Expr::VAArgExprClass:
1182 case Expr::ArraySubscriptExprClass:
1183 case Expr::OMPArraySectionExprClass:
1184 case Expr::BinaryOperatorClass:
1185 case Expr::DependentCoawaitExprClass:
1186 case Expr::CompoundAssignOperatorClass:
1187 case Expr::CStyleCastExprClass:
1188 case Expr::CXXStaticCastExprClass:
1189 case Expr::CXXFunctionalCastExprClass:
1190 case Expr::ImplicitCastExprClass:
1191 case Expr::MaterializeTemporaryExprClass:
1192 case Expr::UnaryOperatorClass: {
1198 case Expr::StmtExprClass:
1201 case Expr::CXXDefaultArgExprClass:
1202 return canThrow(cast<CXXDefaultArgExpr>(E)->getExpr());
1204 case Expr::CXXDefaultInitExprClass:
1205 return canThrow(cast<CXXDefaultInitExpr>(E)->getExpr());
1207 case Expr::ChooseExprClass:
1210 return canThrow(cast<ChooseExpr>(E)->getChosenSubExpr());
1212 case Expr::GenericSelectionExprClass:
1213 if (cast<GenericSelectionExpr>(E)->isResultDependent())
1215 return canThrow(cast<GenericSelectionExpr>(E)->getResultExpr());
1218 case Expr::CXXDependentScopeMemberExprClass:
1219 case Expr::CXXUnresolvedConstructExprClass:
1220 case Expr::DependentScopeDeclRefExprClass:
1221 case Expr::CXXFoldExprClass:
1224 case Expr::AsTypeExprClass:
1225 case Expr::BinaryConditionalOperatorClass:
1226 case Expr::BlockExprClass:
1227 case Expr::CUDAKernelCallExprClass:
1228 case Expr::DeclRefExprClass:
1229 case Expr::ObjCBridgedCastExprClass:
1230 case Expr::ObjCIndirectCopyRestoreExprClass:
1231 case Expr::ObjCProtocolExprClass:
1232 case Expr::ObjCSelectorExprClass:
1233 case Expr::ObjCAvailabilityCheckExprClass:
1234 case Expr::OffsetOfExprClass:
1235 case Expr::PackExpansionExprClass:
1236 case Expr::PseudoObjectExprClass:
1237 case Expr::SubstNonTypeTemplateParmExprClass:
1238 case Expr::SubstNonTypeTemplateParmPackExprClass:
1239 case Expr::FunctionParmPackExprClass:
1240 case Expr::UnaryExprOrTypeTraitExprClass:
1241 case Expr::UnresolvedLookupExprClass:
1242 case Expr::UnresolvedMemberExprClass:
1243 case Expr::TypoExprClass:
1247 case Expr::AddrLabelExprClass:
1248 case Expr::ArrayTypeTraitExprClass:
1249 case Expr::AtomicExprClass:
1250 case Expr::TypeTraitExprClass:
1251 case Expr::CXXBoolLiteralExprClass:
1252 case Expr::CXXNoexceptExprClass:
1253 case Expr::CXXNullPtrLiteralExprClass:
1254 case Expr::CXXPseudoDestructorExprClass:
1255 case Expr::CXXScalarValueInitExprClass:
1256 case Expr::CXXThisExprClass:
1257 case Expr::CXXUuidofExprClass:
1258 case Expr::CharacterLiteralClass:
1259 case Expr::ExpressionTraitExprClass:
1260 case Expr::FloatingLiteralClass:
1261 case Expr::GNUNullExprClass:
1262 case Expr::ImaginaryLiteralClass:
1263 case Expr::ImplicitValueInitExprClass:
1264 case Expr::IntegerLiteralClass:
1265 case Expr::ArrayInitIndexExprClass:
1266 case Expr::NoInitExprClass:
1267 case Expr::ObjCEncodeExprClass:
1268 case Expr::ObjCStringLiteralClass:
1269 case Expr::ObjCBoolLiteralExprClass:
1270 case Expr::OpaqueValueExprClass:
1271 case Expr::PredefinedExprClass:
1272 case Expr::SizeOfPackExprClass:
1273 case Expr::StringLiteralClass:
1277 case Expr::MSPropertyRefExprClass:
1278 case Expr::MSPropertySubscriptExprClass:
1279 llvm_unreachable(
"Invalid class for expression");
1281 #define STMT(CLASS, PARENT) case Expr::CLASS##Class: 1282 #define STMT_RANGE(Base, First, Last) 1283 #define LAST_STMT_RANGE(BASE, FIRST, LAST) 1284 #define EXPR(CLASS, PARENT) 1285 #define ABSTRACT_STMT(STMT) 1286 #include "clang/AST/StmtNodes.inc" 1288 llvm_unreachable(
"Invalid class for expression");
1290 llvm_unreachable(
"Bogus StmtClass");
CanThrowResult canThrow(const Expr *E)
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)
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.
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.
NamespaceDecl - 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.
The noexcept specifier has a bad expression.
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.
void clear()
Clear the base-paths results.
unsigned getDiagID() const
Expr * getExprOperand() const
QualType getLocalUnqualifiedType() const
Return this type with all of the instance-specific qualifiers removed, but without removing any quali...
Defines the clang::Expr interface and subclasses for C++ expressions.
Base wrapper for a particular "section" of type source info.
DeclarationName getDeclName() const
getDeclName - 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.
NoexceptResult
Result type of getNoexceptSpec().
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...
Microsoft throw(...) extension.
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...
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
bool isNothrow(const ASTContext &Ctx, bool ResultIfDependent=false) const
Determine whether this function type has a non-throwing exception specification.
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.
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...
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
bool isInSystemHeader(SourceLocation Loc) const
Returns if a SourceLocation is in a system header.
const FunctionProtoType * T
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
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.
There is no noexcept specifier.
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)
RecordDecl * getDecl() const
CanThrowResult
Possible results from evaluation of a noexcept expression.
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
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
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
The noexcept specifier evaluates to true.
static CanThrowResult canTypeidThrow(Sema &S, const CXXTypeidExpr *DC)
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 ...
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...
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
The noexcept specifier evaluates to false.
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.
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 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.
BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases...
bool isUnresolvedExceptionSpec(ExceptionSpecificationType ESpecType)
NoexceptResult getNoexceptSpec(const ASTContext &Ctx) const
Get the meaning of the noexcept spec on this function, if any.
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...
The noexcept specifier is dependent.
bool CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New)
SourceLocation getLocStart() const LLVM_READONLY
void setType(QualType newType)
SourceLocation getBegin() const
static const FunctionProtoType * GetUnderlyingFunction(QualType T)
SourceLocation getLocation() const
QualType getType() const
Return the type wrapped by this type source info.
bool isBeingDefined() const
isBeingDefined - Return true if this decl is currently being defined.
Expr * IgnoreParens() LLVM_READONLY
IgnoreParens - Ignore parentheses.