summaryrefslogtreecommitdiffstats
path: root/clang/include/clang/Parse/Parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang/include/clang/Parse/Parser.h')
-rw-r--r--clang/include/clang/Parse/Parser.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/clang/include/clang/Parse/Parser.h b/clang/include/clang/Parse/Parser.h
index 2d777ff7ba2..ab43c516cdb 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -819,12 +819,20 @@ private:
return isDeclarationSpecifier();
}
+ /// \brief Specifies the context in which type-id/expression
+ /// disambiguation will occur.
+ enum TentativeCXXTypeIdContext {
+ TypeIdInParens,
+ TypeIdAsTemplateArgument
+ };
+
+
/// isTypeIdInParens - Assumes that a '(' was parsed and now we want to know
/// whether the parens contain an expression or a type-id.
/// Returns true for a type-id and false for an expression.
bool isTypeIdInParens() {
if (getLang().CPlusPlus)
- return isCXXTypeIdInParens();
+ return isCXXTypeId(TypeIdInParens);
return isTypeSpecifierQualifier();
}
@@ -855,12 +863,7 @@ private:
/// the function returns true to let the declaration parsing code handle it.
bool isCXXConditionDeclaration();
- /// isCXXTypeIdInParens - Assumes that a '(' was parsed and now we want to
- /// know whether the parens contain an expression or a type-id.
- /// Returns true for a type-id and false for an expression.
- /// If during the disambiguation process a parsing error is encountered,
- /// the function returns true to let the declaration parsing code handle it.
- bool isCXXTypeIdInParens();
+ bool isCXXTypeId(TentativeCXXTypeIdContext Context);
/// TPResult - Used as the result value for functions whose purpose is to
/// disambiguate C++ constructs by "tentatively parsing" them.
OpenPOWER on IntegriCloud