diff options
Diffstat (limited to 'clang/include/clang/Parse/Parser.h')
| -rw-r--r-- | clang/include/clang/Parse/Parser.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/include/clang/Parse/Parser.h b/clang/include/clang/Parse/Parser.h index c9c586aeac8..b5c1a41650e 100644 --- a/clang/include/clang/Parse/Parser.h +++ b/clang/include/clang/Parse/Parser.h @@ -1221,6 +1221,9 @@ private: bool isAddressOfOperand = false, TypeCastState isTypeCast = NotTypeCast); + /// Returns true if the next token cannot start an expression. + bool isNotExpressionStart(); + /// Returns true if the next token would start a postfix-expression /// suffix. bool isPostfixExpressionSuffixStart() { @@ -1633,6 +1636,15 @@ private: /// specifier or if we're not sure. bool isKnownToBeTypeSpecifier(const Token &Tok) const; + /// \brief Return true if we know that we are definitely looking at a + /// decl-specifier, and isn't part of an expression such as a function-style + /// cast. Return false if it's no a decl-specifier, or we're not sure. + bool isKnownToBeDeclarationSpecifier() { + if (getLangOpts().CPlusPlus) + return isCXXDeclarationSpecifier() == TPResult::True(); + return isDeclarationSpecifier(true); + } + /// isDeclarationStatement - Disambiguates between a declaration or an /// expression statement, when parsing function bodies. /// Returns true for declaration, false for expression. |

