summaryrefslogtreecommitdiffstats
path: root/include/clang/Sema/Scope.h
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2013-10-21 09:34:44 +0000
committerSerge Pavlov <sepavloff@gmail.com>2013-10-21 09:34:44 +0000
commitfb90266d8bb5a977de45d07e702277f4cb54d74e (patch)
tree2b60de2155933f180adbfc19b625d2036bf453ff /include/clang/Sema/Scope.h
parentd186f0b4c15d4c63e0ae7fbe6ca3207871ba2eb9 (diff)
Fix to PR8880 (clang dies processing a for loop).
Due to statement expressions supported as GCC extension, it is possible to put 'break' or 'continue' into a loop/switch statement but outside its body, for example: for ( ; ({ if (first) { first = 0; continue; } 0; }); ) Such usage must be diagnosed as an error, GCC rejects it. To recognize this and similar patterns the flags BreakScope and ContinueScope are temporarily turned off while parsing condition expression. Differential Revision: http://llvm-reviews.chandlerc.com/D1762 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Sema/Scope.h')
-rw-r--r--include/clang/Sema/Scope.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/clang/Sema/Scope.h b/include/clang/Sema/Scope.h
index 249a4c7431..4b0563ed54 100644
--- a/include/clang/Sema/Scope.h
+++ b/include/clang/Sema/Scope.h
@@ -342,6 +342,16 @@ public:
/// Init - This is used by the parser to implement scope caching.
///
void Init(Scope *parent, unsigned flags);
+
+ /// \brief Sets up the specified scope flags and adjusts the scope state
+ /// variables accordingly.
+ ///
+ void SetFlags(unsigned Flags);
+
+ /// \brief Clears the specified scope flags and adjusts the scope state
+ /// variables accordingly.
+ ///
+ void ClearFlags(unsigned Flags);
};
} // end namespace clang