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_cxx_destructor:
158 OutDiag = diag::note_exits_dtor;
161 case QualType::DK_none:
166 const Expr *Init = VD->getInit();
182 InDiag = diag::note_protected_by_variable_init;
190 VD->getInitStyle() == VarDecl::CallInit) {
192 InDiag = diag::note_protected_by_variable_nontriv_destructor;
194 InDiag = diag::note_protected_by_variable_non_pod;
205 if (TD->getUnderlyingType()->isVariablyModifiedType())
207 ? diag::note_protected_by_vla_typedef
208 : diag::note_protected_by_vla_type_alias,
216 void JumpScopeChecker::BuildScopeInformation(
Decl *D,
unsigned &ParentScope) {
219 if (Diags.first || Diags.second) {
220 Scopes.push_back(GotoScope(ParentScope, Diags.first, Diags.second,
222 ParentScope = Scopes.size()-1;
227 if (
VarDecl *VD = dyn_cast<VarDecl>(D))
228 if (
Expr *Init = VD->getInit())
229 BuildScopeInformation(Init, ParentScope);
233 void JumpScopeChecker::BuildScopeInformation(
VarDecl *D,
235 unsigned &ParentScope) {
242 if (destructKind != QualType::DK_none) {
243 std::pair<unsigned,unsigned> Diags;
244 switch (destructKind) {
245 case QualType::DK_cxx_destructor:
246 Diags =
ScopePair(diag::note_enters_block_captures_cxx_obj,
247 diag::note_exits_block_captures_cxx_obj);
249 case QualType::DK_objc_strong_lifetime:
250 Diags =
ScopePair(diag::note_enters_block_captures_strong,
251 diag::note_exits_block_captures_strong);
253 case QualType::DK_objc_weak_lifetime:
254 Diags =
ScopePair(diag::note_enters_block_captures_weak,
255 diag::note_exits_block_captures_weak);
257 case QualType::DK_none:
258 llvm_unreachable(
"non-lifetime captured variable");
263 Scopes.push_back(GotoScope(ParentScope,
264 Diags.first, Diags.second, Loc));
265 ParentScope = Scopes.size()-1;
273 void JumpScopeChecker::BuildScopeInformation(
Stmt *S,
274 unsigned &origParentScope) {
278 unsigned independentParentScope = origParentScope;
279 unsigned &ParentScope = ((isa<Expr>(S) && !isa<StmtExpr>(S))
280 ? origParentScope : independentParentScope);
282 unsigned StmtsToSkip = 0u;
286 case Stmt::AddrLabelExprClass:
287 IndirectJumpTargets.push_back(cast<AddrLabelExpr>(S)->getLabel());
290 case Stmt::ObjCForCollectionStmtClass: {
291 auto *CS = cast<ObjCForCollectionStmt>(S);
292 unsigned Diag = diag::note_protected_by_objc_fast_enumeration;
293 unsigned NewParentScope = Scopes.size();
294 Scopes.push_back(GotoScope(ParentScope, Diag, 0, S->
getLocStart()));
295 BuildScopeInformation(CS->getBody(), NewParentScope);
299 case Stmt::IndirectGotoStmtClass:
305 if (cast<IndirectGotoStmt>(S)->getConstantTarget()) {
306 LabelAndGotoScopes[S] = ParentScope;
311 LabelAndGotoScopes[S] = ParentScope;
312 IndirectJumps.push_back(cast<IndirectGotoStmt>(S));
315 case Stmt::SwitchStmtClass:
318 if (
Stmt *Init = cast<SwitchStmt>(S)->getInit()) {
319 BuildScopeInformation(Init, ParentScope);
322 if (
VarDecl *Var = cast<SwitchStmt>(S)->getConditionVariable()) {
323 BuildScopeInformation(Var, ParentScope);
328 case Stmt::GotoStmtClass:
331 LabelAndGotoScopes[S] = ParentScope;
335 case Stmt::IfStmtClass: {
336 IfStmt *IS = cast<IfStmt>(S);
340 unsigned Diag = IS->
isConstexpr() ? diag::note_protected_by_constexpr_if
341 : diag::note_protected_by_if_available;
344 BuildScopeInformation(Var, ParentScope);
347 unsigned NewParentScope = Scopes.size();
348 Scopes.push_back(GotoScope(ParentScope, Diag, 0, IS->
getLocStart()));
349 BuildScopeInformation(IS->
getCond(), NewParentScope);
352 NewParentScope = Scopes.size();
353 Scopes.push_back(GotoScope(ParentScope, Diag, 0, IS->
getLocStart()));
354 BuildScopeInformation(IS->
getThen(), NewParentScope);
356 NewParentScope = Scopes.size();
357 Scopes.push_back(GotoScope(ParentScope, Diag, 0, IS->
getLocStart()));
358 BuildScopeInformation(Else, NewParentScope);
363 case Stmt::CXXTryStmtClass: {
366 unsigned NewParentScope = Scopes.size();
367 Scopes.push_back(GotoScope(ParentScope,
368 diag::note_protected_by_cxx_try,
369 diag::note_exits_cxx_try,
372 BuildScopeInformation(TryBlock, NewParentScope);
378 unsigned NewParentScope = Scopes.size();
379 Scopes.push_back(GotoScope(ParentScope,
380 diag::note_protected_by_cxx_catch,
381 diag::note_exits_cxx_catch,
388 case Stmt::SEHTryStmtClass: {
391 unsigned NewParentScope = Scopes.size();
392 Scopes.push_back(GotoScope(ParentScope,
393 diag::note_protected_by_seh_try,
394 diag::note_exits_seh_try,
397 BuildScopeInformation(TryBlock, NewParentScope);
402 unsigned NewParentScope = Scopes.size();
403 Scopes.push_back(GotoScope(ParentScope,
404 diag::note_protected_by_seh_except,
405 diag::note_exits_seh_except,
406 Except->getSourceRange().getBegin()));
407 BuildScopeInformation(Except->getBlock(), NewParentScope);
409 unsigned NewParentScope = Scopes.size();
410 Scopes.push_back(GotoScope(ParentScope,
411 diag::note_protected_by_seh_finally,
412 diag::note_exits_seh_finally,
413 Finally->getSourceRange().getBegin()));
414 BuildScopeInformation(Finally->getBlock(), NewParentScope);
420 case Stmt::DeclStmtClass: {
426 for (
auto *I : DS->
decls())
427 BuildScopeInformation(I, origParentScope);
431 case Stmt::ObjCAtTryStmtClass: {
437 unsigned NewParentScope = Scopes.size();
438 Scopes.push_back(GotoScope(ParentScope,
439 diag::note_protected_by_objc_try,
440 diag::note_exits_objc_try,
443 BuildScopeInformation(TryPart, NewParentScope);
449 unsigned NewParentScope = Scopes.size();
450 Scopes.push_back(GotoScope(ParentScope,
451 diag::note_protected_by_objc_catch,
452 diag::note_exits_objc_catch,
455 BuildScopeInformation(AC->
getCatchBody(), NewParentScope);
460 unsigned NewParentScope = Scopes.size();
461 Scopes.push_back(GotoScope(ParentScope,
462 diag::note_protected_by_objc_finally,
463 diag::note_exits_objc_finally,
464 AF->getAtFinallyLoc()));
465 BuildScopeInformation(AF, NewParentScope);
471 case Stmt::ObjCAtSynchronizedStmtClass: {
481 unsigned NewParentScope = Scopes.size();
482 Scopes.push_back(GotoScope(ParentScope,
483 diag::note_protected_by_objc_synchronized,
484 diag::note_exits_objc_synchronized,
486 BuildScopeInformation(AS->
getSynchBody(), NewParentScope);
490 case Stmt::ObjCAutoreleasePoolStmtClass: {
495 unsigned NewParentScope = Scopes.size();
496 Scopes.push_back(GotoScope(ParentScope,
497 diag::note_protected_by_objc_autoreleasepool,
498 diag::note_exits_objc_autoreleasepool,
500 BuildScopeInformation(AS->
getSubStmt(), NewParentScope);
504 case Stmt::ExprWithCleanupsClass: {
509 for (
unsigned i = 0, e = EWC->
getNumObjects(); i != e; ++i) {
511 for (
const auto &CI : BDecl->
captures()) {
512 VarDecl *variable = CI.getVariable();
513 BuildScopeInformation(variable, BDecl, origParentScope);
519 case Stmt::MaterializeTemporaryExprClass: {
526 const Expr *ExtendedObject =
528 CommaLHS, Adjustments);
530 Scopes.push_back(GotoScope(ParentScope, 0,
531 diag::note_exits_temporary_dtor,
533 origParentScope = Scopes.size()-1;
539 case Stmt::CaseStmtClass:
540 case Stmt::DefaultStmtClass:
541 case Stmt::LabelStmtClass:
542 LabelAndGotoScopes[S] = ParentScope;
562 if (
SwitchCase *SC = dyn_cast<SwitchCase>(SubStmt))
563 Next = SC->getSubStmt();
564 else if (
LabelStmt *LS = dyn_cast<LabelStmt>(SubStmt))
565 Next = LS->getSubStmt();
569 LabelAndGotoScopes[SubStmt] = ParentScope;
574 BuildScopeInformation(SubStmt, ParentScope);
580 void JumpScopeChecker::VerifyJumps() {
581 while (!Jumps.empty()) {
582 Stmt *Jump = Jumps.pop_back_val();
585 if (
GotoStmt *GS = dyn_cast<GotoStmt>(Jump)) {
587 if (GS->getLabel()->getStmt()) {
588 CheckJump(GS, GS->getLabel()->getStmt(), GS->getGotoLoc(),
589 diag::err_goto_into_protected_scope,
590 diag::ext_goto_into_protected_scope,
591 diag::warn_cxx98_compat_goto_into_protected_scope);
599 LabelDecl *Target = IGS->getConstantTarget();
600 CheckJump(IGS, Target->
getStmt(), IGS->getGotoLoc(),
601 diag::err_goto_into_protected_scope,
602 diag::ext_goto_into_protected_scope,
603 diag::warn_cxx98_compat_goto_into_protected_scope);
613 if (
CaseStmt *CS = dyn_cast<CaseStmt>(SC))
614 Loc = CS->getLocStart();
615 else if (
DefaultStmt *DS = dyn_cast<DefaultStmt>(SC))
616 Loc = DS->getLocStart();
618 Loc = SC->getLocStart();
619 CheckJump(SS, SC, Loc, diag::err_switch_into_protected_scope, 0,
620 diag::warn_cxx98_compat_switch_into_protected_scope);
644 void JumpScopeChecker::VerifyIndirectJumps() {
645 if (IndirectJumps.empty())
return;
649 if (IndirectJumpTargets.empty()) {
650 S.Diag(IndirectJumps[0]->getGotoLoc(),
651 diag::err_indirect_goto_without_addrlabel);
658 typedef std::pair<unsigned, IndirectGotoStmt*> JumpScope;
661 llvm::DenseMap<unsigned, IndirectGotoStmt*> JumpScopesMap;
663 I = IndirectJumps.begin(), E = IndirectJumps.end(); I != E; ++I) {
667 unsigned IGScope = LabelAndGotoScopes[IG];
669 if (!Entry) Entry = IG;
671 JumpScopes.reserve(JumpScopesMap.size());
672 for (llvm::DenseMap<unsigned, IndirectGotoStmt*>::iterator
673 I = JumpScopesMap.begin(), E = JumpScopesMap.end(); I != E; ++I)
674 JumpScopes.push_back(*I);
680 llvm::DenseMap<unsigned, LabelDecl*> TargetScopes;
682 I = IndirectJumpTargets.begin(), E = IndirectJumpTargets.end();
687 unsigned LabelScope = LabelAndGotoScopes[TheLabel->
getStmt()];
688 LabelDecl *&Target = TargetScopes[LabelScope];
689 if (!Target) Target = TheLabel;
700 llvm::BitVector Reachable(Scopes.size(),
false);
701 for (llvm::DenseMap<unsigned,LabelDecl*>::iterator
702 TI = TargetScopes.begin(), TE = TargetScopes.end(); TI != TE; ++TI) {
703 unsigned TargetScope = TI->first;
711 unsigned Min = TargetScope;
719 if (Scopes[Min].InDiag)
break;
721 Min = Scopes[Min].ParentScope;
727 I = JumpScopes.begin(), E = JumpScopes.end(); I != E; ++I) {
728 unsigned Scope = I->first;
735 bool IsReachable =
false;
737 if (Reachable.test(Scope)) {
740 for (
unsigned S = I->first; S != Scope; S = Scopes[S].ParentScope)
748 if (Scope == 0 || Scope < Min)
break;
751 if (Scopes[Scope].OutDiag)
break;
753 Scope = Scopes[Scope].ParentScope;
757 if (IsReachable)
continue;
759 DiagnoseIndirectJump(I->second, I->first, TargetLabel, TargetScope);
767 return (JumpDiag == diag::err_goto_into_protected_scope &&
768 (InDiagNote == diag::note_protected_by_variable_init ||
769 InDiagNote == diag::note_protected_by_variable_nontriv_destructor));
776 InDiagNote == diag::note_protected_by_variable_non_pod;
784 S.
Diag(Jump->
getGotoLoc(), diag::err_indirect_goto_in_protected_scope);
793 for (
unsigned I = 0, E = ToScopes.size(); I != E; ++I)
794 if (Scopes[ToScopes[I]].InDiag)
795 S.Diag(Scopes[ToScopes[I]].Loc, Scopes[ToScopes[I]].InDiag);
802 unsigned TargetScope) {
806 unsigned Common = GetDeepestCommonScope(JumpScope, TargetScope);
807 bool Diagnosed =
false;
810 for (
unsigned I = JumpScope; I != Common; I = Scopes[I].ParentScope)
811 if (Scopes[I].OutDiag) {
813 S.Diag(Scopes[I].Loc, Scopes[I].OutDiag);
819 for (
unsigned I = TargetScope; I != Common; I = Scopes[I].ParentScope)
821 ToScopesCXX98Compat.push_back(I);
822 else if (Scopes[I].InDiag) {
824 S.Diag(Scopes[I].Loc, Scopes[I].InDiag);
828 if (!Diagnosed && !ToScopesCXX98Compat.empty()) {
830 diag::warn_cxx98_compat_indirect_goto_in_protected_scope);
832 NoteJumpIntoScopes(ToScopesCXX98Compat);
839 unsigned JumpDiagError,
unsigned JumpDiagWarning,
840 unsigned JumpDiagCXX98Compat) {
846 unsigned FromScope = LabelAndGotoScopes[From];
847 unsigned ToScope = LabelAndGotoScopes[To];
850 if (FromScope == ToScope)
return;
853 if (isa<GotoStmt>(From) || isa<IndirectGotoStmt>(From)) {
856 for (
unsigned I = FromScope; I > ToScope; I = Scopes[I].ParentScope) {
857 if (Scopes[I].InDiag == diag::note_protected_by_seh_finally) {
858 S.Diag(From->
getLocStart(), diag::warn_jump_out_of_seh_finally);
864 unsigned CommonScope = GetDeepestCommonScope(FromScope, ToScope);
867 if (CommonScope == ToScope)
return;
873 for (
unsigned I = ToScope; I != CommonScope; I = Scopes[I].ParentScope) {
874 if (S.getLangOpts().MSVCCompat && JumpDiagWarning != 0 &&
876 ToScopesWarning.push_back(I);
878 ToScopesCXX98Compat.push_back(I);
879 else if (Scopes[I].InDiag)
880 ToScopesError.push_back(I);
884 if (!ToScopesWarning.empty()) {
885 S.Diag(DiagLoc, JumpDiagWarning);
886 NoteJumpIntoScopes(ToScopesWarning);
890 if (!ToScopesError.empty()) {
891 S.Diag(DiagLoc, JumpDiagError);
892 NoteJumpIntoScopes(ToScopesError);
896 if (ToScopesError.empty() && !ToScopesCXX98Compat.empty()) {
897 S.Diag(DiagLoc, JumpDiagCXX98Compat);
898 NoteJumpIntoScopes(ToScopesCXX98Compat);
902 void JumpScopeChecker::CheckGotoStmt(
GotoStmt *GS) {
904 S.Diag(GS->
getGotoLoc(), diag::err_goto_ms_asm_label)
911 void Sema::DiagnoseInvalidJumps(
Stmt *Body) {
912 (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-...
VarDecl - An instance of this class is created to represent 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
getIdentifier - 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
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
Expr - This represents one expression.
const FunctionProtoType * T
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
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
LabelDecl - 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 getLocStart() const LLVM_READONLY
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...