diff options
Diffstat (limited to 'include/clang/Parse/Parser.h')
-rw-r--r-- | include/clang/Parse/Parser.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index d613ae1..75458d8 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -105,6 +105,24 @@ class Parser { } }; + /// \brief RAII object that enters an unevaluated operand. + class EnterUnevaluatedOperand { + /// \brief The action object. + Action &Actions; + + /// \brief Whether we were previously within an unevaluated operand. + bool PreviouslyInUnevaluatedOperand; + + public: + explicit EnterUnevaluatedOperand(Action &Actions) : Actions(Actions) { + PreviouslyInUnevaluatedOperand = Actions.setUnevaluatedOperand(true); + } + + ~EnterUnevaluatedOperand() { + Actions.setUnevaluatedOperand(PreviouslyInUnevaluatedOperand); + } + }; + public: Parser(Preprocessor &PP, Action &Actions); ~Parser(); |