21 #include "llvm/ADT/BitVector.h" 22 using namespace clang;
32 class JumpScopeChecker {
37 const bool Permissive;
60 GotoScope(
unsigned parentScope,
unsigned InDiag,
unsigned OutDiag,
62 : ParentScope(parentScope), InDiag(InDiag), OutDiag(OutDiag), Loc(L) {}
66 llvm::DenseMap<Stmt*, unsigned> LabelAndGotoScopes;
72 JumpScopeChecker(
Stmt *Body,
Sema &S);
74 void BuildScopeInformation(
Decl *D,
unsigned &ParentScope);
76 unsigned &ParentScope);
77 void BuildScopeInformation(
Stmt *S,
unsigned &origParentScope);
80 void VerifyIndirectJumps();
85 unsigned JumpDiag,
unsigned JumpDiagWarning,
86 unsigned JumpDiagCXX98Compat);
89 unsigned GetDeepestCommonScope(
unsigned A,
unsigned B);
93 #define CHECK_PERMISSIVE(x) (assert(Permissive || !(x)), (Permissive && (x))) 95 JumpScopeChecker::JumpScopeChecker(
Stmt *Body,
Sema &s)
96 : S(s), Permissive(s.hasAnyUnrecoverableErrorsInThisFunction()) {
102 unsigned BodyParentScope = 0;
103 BuildScopeInformation(Body, BodyParentScope);
107 VerifyIndirectJumps();
112 unsigned JumpScopeChecker::GetDeepestCommonScope(
unsigned A,
unsigned B) {
117 assert(Scopes[B].ParentScope < B);
118 B = Scopes[B].ParentScope;
120 assert(Scopes[A].ParentScope < A);
121 A = Scopes[A].ParentScope;
132 if (
const VarDecl *VD = dyn_cast<VarDecl>(D)) {
134 unsigned OutDiag = 0;
136 if (VD->getType()->isVariablyModifiedType())
137 InDiag = diag::note_protected_by_vla;
139 if (VD->hasAttr<BlocksAttr>())
140 return ScopePair(diag::note_protected_by___block,
141 diag::note_exits___block);
143 if (VD->hasAttr<CleanupAttr>())
144 return ScopePair(diag::note_protected_by_cleanup,
145 diag::note_exits_cleanup);
147 if (VD->hasLocalStorage()) {
148 switch (VD->getType().isDestructedType()) {
149 case QualType::DK_objc_strong_lifetime:
150 return ScopePair(diag::note_protected_by_objc_strong_init,
151 diag::note_exits_objc_strong);
153 case QualType::DK_objc_weak_lifetime:
154 return ScopePair(diag::note_protected_by_objc_weak_init,
155 diag::note_exits_objc_weak);
157 case QualType::DK_nontrivial_c_struct:
158 return ScopePair(diag::note_protected_by_non_trivial_c_struct_init,
159 diag::note_exits_dtor);
161 case QualType::DK_cxx_destructor:
162 OutDiag = diag::note_exits_dtor;
165 case QualType::DK_none:
170 const Expr *Init = VD->getInit();
186 InDiag = diag::note_protected_by_variable_init;
194 VD->getInitStyle() == VarDecl::CallInit) {
196 InDiag = diag::note_protected_by_variable_nontriv_destructor;
198 InDiag = diag::note_protected_by_variable_non_pod;
209 if (TD->getUnderlyingType()->isVariablyModifiedType())
211 ? diag::note_protected_by_vla_typedef
212 : diag::note_protected_by_vla_type_alias,
220 void JumpScopeChecker::BuildScopeInformation(
Decl *D,
unsigned &ParentScope) {
223 if (Diags.first || Diags.second) {
224 Scopes.push_back(GotoScope(ParentScope, Diags.first, Diags.second,
226 ParentScope = Scopes.size()-1;
231 if (
VarDecl *VD = dyn_cast<VarDecl>(D))
232 if (
Expr *Init = VD->getInit())
233 BuildScopeInformation(Init, ParentScope);
237 void JumpScopeChecker::BuildScopeInformation(
VarDecl *D,
239 unsigned &ParentScope) {
246 if (destructKind != QualType::DK_none) {
247 std::pair<unsigned,unsigned> Diags;
248 switch (destructKind) {
249 case QualType::DK_cxx_destructor:
250 Diags =
ScopePair(diag::note_enters_block_captures_cxx_obj,
251 diag::note_exits_block_captures_cxx_obj);
253 case QualType::DK_objc_strong_lifetime:
254 Diags =
ScopePair(diag::note_enters_block_captures_strong,
255 diag::note_exits_block_captures_strong);
257 case QualType::DK_objc_weak_lifetime:
258 Diags =
ScopePair(diag::note_enters_block_captures_weak,
259 diag::note_exits_block_captures_weak);
261 case QualType::DK_nontrivial_c_struct:
262 Diags =
ScopePair(diag::note_enters_block_captures_non_trivial_c_struct,
263 diag::note_exits_block_captures_non_trivial_c_struct);
265 case QualType::DK_none:
266 llvm_unreachable(
"non-lifetime captured variable");
271 Scopes.push_back(GotoScope(ParentScope,
272 Diags.first, Diags.second, Loc));
273 ParentScope = Scopes.size()-1;
281 void JumpScopeChecker::BuildScopeInformation(
Stmt *S,
282 unsigned &origParentScope) {
286 unsigned independentParentScope = origParentScope;
287 unsigned &ParentScope = ((isa<Expr>(S) && !isa<StmtExpr>(S))
288 ? origParentScope : independentParentScope);
290 unsigned StmtsToSkip = 0u;
294 case Stmt::AddrLabelExprClass:
295 IndirectJumpTargets.push_back(cast<AddrLabelExpr>(S)->getLabel());
298 case Stmt::ObjCForCollectionStmtClass: {
299 auto *CS = cast<ObjCForCollectionStmt>(S);
300 unsigned Diag = diag::note_protected_by_objc_fast_enumeration;
301 unsigned NewParentScope = Scopes.size();
302 Scopes.push_back(GotoScope(ParentScope, Diag, 0, S->
getLocStart()));
303 BuildScopeInformation(CS->getBody(), NewParentScope);
307 case Stmt::IndirectGotoStmtClass:
313 if (cast<IndirectGotoStmt>(S)->getConstantTarget()) {
314 LabelAndGotoScopes[S] = ParentScope;
319 LabelAndGotoScopes[S] = ParentScope;
320 IndirectJumps.push_back(cast<IndirectGotoStmt>(S));
323 case Stmt::SwitchStmtClass:
326 if (
Stmt *Init = cast<SwitchStmt>(S)->getInit()) {
327 BuildScopeInformation(Init, ParentScope);
330 if (
VarDecl *Var = cast<SwitchStmt>(S)->getConditionVariable()) {
331 BuildScopeInformation(Var, ParentScope);
336 case Stmt::GotoStmtClass:
339 LabelAndGotoScopes[S] = ParentScope;
343 case Stmt::IfStmtClass: {
344 IfStmt *IS = cast<IfStmt>(S);
348 unsigned Diag = IS->
isConstexpr() ? diag::note_protected_by_constexpr_if
349 : diag::note_protected_by_if_available;
352 BuildScopeInformation(Var, ParentScope);
355 unsigned NewParentScope = Scopes.size();
356 Scopes.push_back(GotoScope(ParentScope, Diag, 0, IS->
getLocStart()));
357 BuildScopeInformation(IS->
getCond(), NewParentScope);
360 NewParentScope = Scopes.size();
361 Scopes.push_back(GotoScope(ParentScope, Diag, 0, IS->
getLocStart()));
362 BuildScopeInformation(IS->
getThen(), NewParentScope);
364 NewParentScope = Scopes.size();
365 Scopes.push_back(GotoScope(ParentScope, Diag, 0, IS->
getLocStart()));
366 BuildScopeInformation(Else, NewParentScope);
371 case Stmt::CXXTryStmtClass: {
374 unsigned NewParentScope = Scopes.size();
375 Scopes.push_back(GotoScope(ParentScope,
376 diag::note_protected_by_cxx_try,
377 diag::note_exits_cxx_try,
380 BuildScopeInformation(TryBlock, NewParentScope);
386 unsigned NewParentScope = Scopes.size();
387 Scopes.push_back(GotoScope(ParentScope,
388 diag::note_protected_by_cxx_catch,
389 diag::note_exits_cxx_catch,
396 case Stmt::SEHTryStmtClass: {
399 unsigned NewParentScope = Scopes.size();
400 Scopes.push_back(GotoScope(ParentScope,
401 diag::note_protected_by_seh_try,
402 diag::note_exits_seh_try,
405 BuildScopeInformation(TryBlock, NewParentScope);
410 unsigned NewParentScope = Scopes.size();
411 Scopes.push_back(GotoScope(ParentScope,
412 diag::note_protected_by_seh_except,
413 diag::note_exits_seh_except,
414 Except->getSourceRange().getBegin()));
415 BuildScopeInformation(Except->getBlock(), NewParentScope);
417 unsigned NewParentScope = Scopes.size();
418 Scopes.push_back(GotoScope(ParentScope,
419 diag::note_protected_by_seh_finally,
420 diag::note_exits_seh_finally,
421 Finally->getSourceRange().getBegin()));
422 BuildScopeInformation(Finally->getBlock(), NewParentScope);
428 case Stmt::DeclStmtClass: {
434 for (
auto *I : DS->
decls())
435 BuildScopeInformation(I, origParentScope);
439 case Stmt::ObjCAtTryStmtClass: {
445 unsigned NewParentScope = Scopes.size();
446 Scopes.push_back(GotoScope(ParentScope,
447 diag::note_protected_by_objc_try,
448 diag::note_exits_objc_try,
451 BuildScopeInformation(TryPart, NewParentScope);
457 unsigned NewParentScope = Scopes.size();
458 Scopes.push_back(GotoScope(ParentScope,
459 diag::note_protected_by_objc_catch,
460 diag::note_exits_objc_catch,
463 BuildScopeInformation(AC->
getCatchBody(), NewParentScope);
468 unsigned NewParentScope = Scopes.size();
469 Scopes.push_back(GotoScope(ParentScope,
470 diag::note_protected_by_objc_finally,
471 diag::note_exits_objc_finally,
472 AF->getAtFinallyLoc()));
473 BuildScopeInformation(AF, NewParentScope);
479 case Stmt::ObjCAtSynchronizedStmtClass: {
489 unsigned NewParentScope = Scopes.size();
490 Scopes.push_back(GotoScope(ParentScope,
491 diag::note_protected_by_objc_synchronized,
492 diag::note_exits_objc_synchronized,
494 BuildScopeInformation(AS->
getSynchBody(), NewParentScope);
498 case Stmt::ObjCAutoreleasePoolStmtClass: {
503 unsigned NewParentScope = Scopes.size();
504 Scopes.push_back(GotoScope(ParentScope,
505 diag::note_protected_by_objc_autoreleasepool,
506 diag::note_exits_objc_autoreleasepool,
508 BuildScopeInformation(AS->
getSubStmt(), NewParentScope);
512 case Stmt::ExprWithCleanupsClass: {
517 for (
unsigned i = 0, e = EWC->
getNumObjects(); i != e; ++i) {
519 for (
const auto &CI : BDecl->
captures()) {
520 VarDecl *variable = CI.getVariable();
521 BuildScopeInformation(variable, BDecl, origParentScope);
527 case Stmt::MaterializeTemporaryExprClass: {
534 const Expr *ExtendedObject =
536 CommaLHS, Adjustments);
538 Scopes.push_back(GotoScope(ParentScope, 0,
539 diag::note_exits_temporary_dtor,
541 origParentScope = Scopes.size()-1;
547 case Stmt::CaseStmtClass:
548 case Stmt::DefaultStmtClass:
549 case Stmt::LabelStmtClass:
550 LabelAndGotoScopes[S] = ParentScope;
570 if (
SwitchCase *SC = dyn_cast<SwitchCase>(SubStmt))
571 Next = SC->getSubStmt();
572 else if (
LabelStmt *LS = dyn_cast<LabelStmt>(SubStmt))
573 Next = LS->getSubStmt();
577 LabelAndGotoScopes[SubStmt] = ParentScope;
582 BuildScopeInformation(SubStmt, ParentScope);
588 void JumpScopeChecker::VerifyJumps() {
589 while (!Jumps.empty()) {
590 Stmt *Jump = Jumps.pop_back_val();
593 if (
GotoStmt *GS = dyn_cast<GotoStmt>(Jump)) {
595 if (GS->getLabel()->getStmt()) {
596 CheckJump(GS, GS->getLabel()->getStmt(), GS->getGotoLoc(),
597 diag::err_goto_into_protected_scope,
598 diag::ext_goto_into_protected_scope,
599 diag::warn_cxx98_compat_goto_into_protected_scope);
608 CheckJump(IGS, Target->
getStmt(), IGS->getGotoLoc(),
609 diag::err_goto_into_protected_scope,
610 diag::ext_goto_into_protected_scope,
611 diag::warn_cxx98_compat_goto_into_protected_scope);
621 if (
CaseStmt *CS = dyn_cast<CaseStmt>(SC))
622 Loc = CS->getLocStart();
623 else if (
DefaultStmt *DS = dyn_cast<DefaultStmt>(SC))
624 Loc = DS->getLocStart();
626 Loc = SC->getLocStart();
627 CheckJump(SS, SC, Loc, diag::err_switch_into_protected_scope, 0,
628 diag::warn_cxx98_compat_switch_into_protected_scope);
652 void JumpScopeChecker::VerifyIndirectJumps() {
653 if (IndirectJumps.empty())
return;
657 if (IndirectJumpTargets.empty()) {
658 S.Diag(IndirectJumps[0]->getGotoLoc(),
659 diag::err_indirect_goto_without_addrlabel);
666 typedef std::pair<unsigned, IndirectGotoStmt*> JumpScope;
669 llvm::DenseMap<unsigned, IndirectGotoStmt*> JumpScopesMap;
671 I = IndirectJumps.begin(), E = IndirectJumps.end(); I != E; ++I) {
675 unsigned IGScope = LabelAndGotoScopes[IG];
677 if (!Entry) Entry = IG;
679 JumpScopes.reserve(JumpScopesMap.size());
680 for (llvm::DenseMap<unsigned, IndirectGotoStmt*>::iterator
681 I = JumpScopesMap.begin(), E = JumpScopesMap.end(); I != E; ++I)
682 JumpScopes.push_back(*I);
688 llvm::DenseMap<unsigned, LabelDecl*> TargetScopes;
690 I = IndirectJumpTargets.begin(), E = IndirectJumpTargets.end();
695 unsigned LabelScope = LabelAndGotoScopes[TheLabel->
getStmt()];
697 if (!Target) Target = TheLabel;
708 llvm::BitVector Reachable(Scopes.size(),
false);
709 for (llvm::DenseMap<unsigned,LabelDecl*>::iterator
710 TI = TargetScopes.begin(), TE = TargetScopes.end(); TI != TE; ++TI) {
711 unsigned TargetScope = TI->first;
719 unsigned Min = TargetScope;
727 if (Scopes[Min].InDiag)
break;
729 Min = Scopes[Min].ParentScope;
735 I = JumpScopes.begin(), E = JumpScopes.end(); I != E; ++I) {
736 unsigned Scope = I->first;
743 bool IsReachable =
false;
745 if (Reachable.test(Scope)) {
748 for (
unsigned S = I->first; S != Scope; S = Scopes[S].ParentScope)
756 if (Scope == 0 || Scope < Min)
break;
759 if (Scopes[Scope].OutDiag)
break;
761 Scope = Scopes[Scope].ParentScope;
765 if (IsReachable)
continue;
767 DiagnoseIndirectJump(I->second, I->first, TargetLabel, TargetScope);
775 return (JumpDiag == diag::err_goto_into_protected_scope &&
776 (InDiagNote == diag::note_protected_by_variable_init ||
777 InDiagNote == diag::note_protected_by_variable_nontriv_destructor));
784 InDiagNote == diag::note_protected_by_variable_non_pod;
792 S.
Diag(Jump->
getGotoLoc(), diag::err_indirect_goto_in_protected_scope);
801 for (
unsigned I = 0, E = ToScopes.size(); I != E; ++I)
802 if (Scopes[ToScopes[I]].InDiag)
803 S.Diag(Scopes[ToScopes[I]].Loc, Scopes[ToScopes[I]].InDiag);
810 unsigned TargetScope) {
814 unsigned Common = GetDeepestCommonScope(JumpScope, TargetScope);
815 bool Diagnosed =
false;
818 for (
unsigned I = JumpScope; I != Common; I = Scopes[I].ParentScope)
819 if (Scopes[I].OutDiag) {
821 S.Diag(Scopes[I].Loc, Scopes[I].OutDiag);
827 for (
unsigned I = TargetScope; I != Common; I = Scopes[I].ParentScope)
829 ToScopesCXX98Compat.push_back(I);
830 else if (Scopes[I].InDiag) {
832 S.Diag(Scopes[I].Loc, Scopes[I].InDiag);
836 if (!Diagnosed && !ToScopesCXX98Compat.empty()) {
838 diag::warn_cxx98_compat_indirect_goto_in_protected_scope);
840 NoteJumpIntoScopes(ToScopesCXX98Compat);
847 unsigned JumpDiagError,
unsigned JumpDiagWarning,
848 unsigned JumpDiagCXX98Compat) {
854 unsigned FromScope = LabelAndGotoScopes[From];
855 unsigned ToScope = LabelAndGotoScopes[To];
858 if (FromScope == ToScope)
return;
861 if (isa<GotoStmt>(From) || isa<IndirectGotoStmt>(From)) {
864 for (
unsigned I = FromScope; I > ToScope; I = Scopes[I].ParentScope) {
865 if (Scopes[I].InDiag == diag::note_protected_by_seh_finally) {
866 S.Diag(From->
getLocStart(), diag::warn_jump_out_of_seh_finally);
872 unsigned CommonScope = GetDeepestCommonScope(FromScope, ToScope);
875 if (CommonScope == ToScope)
return;
881 for (
unsigned I = ToScope; I != CommonScope; I = Scopes[I].ParentScope) {
882 if (S.getLangOpts().MSVCCompat && JumpDiagWarning != 0 &&
884 ToScopesWarning.push_back(I);
886 ToScopesCXX98Compat.push_back(I);
887 else if (Scopes[I].InDiag)
888 ToScopesError.push_back(I);
892 if (!ToScopesWarning.empty()) {
893 S.Diag(DiagLoc, JumpDiagWarning);
894 NoteJumpIntoScopes(ToScopesWarning);
898 if (!ToScopesError.empty()) {
899 S.Diag(DiagLoc, JumpDiagError);
900 NoteJumpIntoScopes(ToScopesError);
904 if (ToScopesError.empty() && !ToScopesCXX98Compat.empty()) {
905 S.Diag(DiagLoc, JumpDiagCXX98Compat);
906 NoteJumpIntoScopes(ToScopesCXX98Compat);
910 void JumpScopeChecker::CheckGotoStmt(
GotoStmt *GS) {
912 S.Diag(GS->
getGotoLoc(), diag::err_goto_ms_asm_label)
919 void Sema::DiagnoseInvalidJumps(
Stmt *Body) {
920 (void)JumpScopeChecker(Body, *
this);
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
const Stmt * getElse() const
A (possibly-)qualified type.
const Expr * skipRValueSubobjectAdjustments(SmallVectorImpl< const Expr *> &CommaLHS, SmallVectorImpl< SubobjectAdjustment > &Adjustments) const
Walk outwards from an expression we want to bind a reference to and find the expression whose lifetim...
Stmt - This represents one statement.
const ObjCAtFinallyStmt * getFinallyStmt() const
Retrieve the @finally statement, if any.
CXXCatchStmt * getHandler(unsigned i)
IfStmt - This represents an if/then/else.
static bool IsMicrosoftJumpWarning(unsigned JumpDiag, unsigned InDiagNote)
Return true if a particular error+note combination must be downgraded to a warning in Microsoft mode...
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
Decl - This represents one declaration (or definition), e.g.
Stmt * getHandlerBlock() const
bool isPOD() const
Whether this class is a POD-type (C++ [class]p4)
SourceLocation getIdentLoc() const
Represents a call to a C++ constructor.
SourceLocation getGotoLoc() const
Represents a C++ constructor within a class.
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
bool isDefaultConstructor() const
Whether this constructor is a default constructor (C++ [class.ctor]p5), which can be used to default-...
Represents a variable declaration or definition.
#define CHECK_PERMISSIVE(x)
Defines the Objective-C statement AST node classes.
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Defines the clang::Expr interface and subclasses for C++ expressions.
const Stmt * getSubStmt() const
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
LabelStmt - Represents a label, which has a substatement.
Expr * GetTemporaryExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue...
Represents Objective-C's @catch statement.
IndirectGotoStmt - This represents an indirect goto.
Scope - A scope is a transient data structure that is used while parsing the program.
const LangOptions & getLangOpts() const
const ObjCAtCatchStmt * getCatchStmt(unsigned I) const
Retrieve a @catch statement.
Sema - This implements semantic analysis and AST building for C.
SourceLocation getLocStart() const LLVM_READONLY
Pepresents a block literal declaration, which is like an unnamed FunctionDecl.
Expr - This represents one expression.
const Stmt * getThen() const
const CompoundStmt * getSynchBody() const
Represents Objective-C's @synchronized statement.
CXXTryStmt - A C++ try block, including all handlers.
SourceLocation getAtTryLoc() const
Retrieve the location of the @ in the @try.
LabelDecl * getLabel() const
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
const Stmt * getTryBody() const
Retrieve the @try body.
std::pair< unsigned, unsigned > ScopePair
SourceLocation getAtLoc() const
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
Encodes a location in the source.
const Stmt * getCatchBody() const
unsigned getNumHandlers() const
const SwitchCase * getSwitchCaseList() const
SourceLocation getLocStart() const LLVM_READONLY
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Represents the declaration of a label.
SourceLocation getGotoLoc() const
bool isMSAsmLabel() const
DestructionKind isDestructedType() const
Returns a nonzero value if objects of this type require non-trivial work to clean up after...
SourceLocation getAtCatchLoc() const
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Base class for declarations which introduce a typedef-name.
LabelStmt * getStmt() const
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "if" statement, if any.
Dataflow Directional Tag Classes.
ArrayRef< Capture > captures() const
StmtClass getStmtClass() const
const CXXRecordDecl * getParent() const
Returns the parent of this method declaration, which is the class in which this method is defined...
SEHExceptStmt * getExceptHandler() const
Returns 0 if not defined.
const Expr * getSynchExpr() const
bool isObjCAvailabilityCheck() const
SwitchStmt - This represents a 'switch' stmt.
unsigned getNumObjects() const
Represents Objective-C's @finally statement.
SEHFinallyStmt * getFinallyHandler() const
GotoStmt - This represents a direct goto.
const SwitchCase * getNextSwitchCase() const
static ScopePair GetDiagForGotoScopeDecl(Sema &S, const Decl *D)
GetDiagForGotoScopeDecl - If this decl induces a new goto scope, return a diagnostic that should be e...
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
static void DiagnoseIndirectJumpStmt(Sema &S, IndirectGotoStmt *Jump, LabelDecl *Target, bool &Diagnosed)
Produce primary diagnostic for an indirect jump statement.
CXXCatchStmt - This represents a C++ catch block.
CleanupObject getObject(unsigned i) const
SourceLocation getAtSynchronizedLoc() const
CompoundStmt * getTryBlock()
Represents Objective-C's @try ... @catch ... @finally statement.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
const Expr * getCond() const
Automatic storage duration (most local variables).
SourceLocation getBegin() const
const LangOptions & getLangOpts() const
Represents Objective-C's @autoreleasepool Statement.
CompoundStmt * getTryBlock() const
SourceLocation getLocation() const
static bool IsCXX98CompatWarning(Sema &S, unsigned InDiagNote)
Return true if a particular note should be downgraded to a compatibility warning in C++11 mode...