diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2013-01-16 19:32:21 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2013-01-16 19:32:21 +0000 |
commit | 31672b1745195d709b641f1c0f44e203742fa73b (patch) | |
tree | 12fbebdd3494a696805c698f0b60668fd5038e2c /include/clang/Lex/Preprocessor.h | |
parent | f0e00046711280d494f3ef2d85ae67a442b97406 (diff) |
No longer crashing with an assert when __has_include or __has_include_next is used outside of a preprocessor directive. This fixes PR14837.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/Preprocessor.h')
-rw-r--r-- | include/clang/Lex/Preprocessor.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index e7bd0dfeec..faaec3517d 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -160,6 +160,9 @@ class Preprocessor : public RefCountedBase<Preprocessor> { /// \brief True if pragmas are enabled. bool PragmasEnabled : 1; + /// \brief True if we are currently preprocessing a #if or #elif directive + bool ParsingIfOrElifDirective; + /// \brief True if we are pre-expanding macro arguments. bool InMacroArgPreExpansion; @@ -446,6 +449,11 @@ public: /// \brief Retrieve the module loader associated with this preprocessor. ModuleLoader &getModuleLoader() const { return TheModuleLoader; } + /// \brief True if we are currently preprocessing a #if or #elif directive + bool isParsingIfOrElifDirective() const { + return ParsingIfOrElifDirective; + } + /// SetCommentRetentionState - Control whether or not the preprocessor retains /// comments in output. void SetCommentRetentionState(bool KeepComments, bool KeepMacroComments) { |