diff options
Diffstat (limited to 'clang/include')
-rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.def | 2 | ||||
-rw-r--r-- | clang/include/clang/Parse/Parser.h | 17 |
2 files changed, 10 insertions, 9 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.def b/clang/include/clang/Basic/DiagnosticSemaKinds.def index d4d68a4d349..fd6055103b1 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.def +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.def @@ -497,8 +497,6 @@ DIAG(note_template_nontype_parm_prev_declaration, NOTE, // C++ Template Argument Lists DIAG(err_template_arg_list_different_arity, ERROR, "%select{too few|too many}0 template arguments for %select{class template|function template|template template parameter|template}1 %2") -DIAG(note_template_parameter_here, ERROR, - "template parameter is declared here") DIAG(err_template_arg_must_be_type, ERROR, "template argument for template type parameter must be a type") DIAG(err_template_arg_must_be_expr, ERROR, 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. |