diff options
Diffstat (limited to 'clang/include/clang')
| -rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.def | 22 | ||||
| -rw-r--r-- | clang/include/clang/Parse/Action.h | 2 | ||||
| -rw-r--r-- | clang/include/clang/Parse/Ownership.h | 2 | ||||
| -rw-r--r-- | clang/include/clang/Parse/Parser.h | 4 |
4 files changed, 27 insertions, 3 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.def b/clang/include/clang/Basic/DiagnosticSemaKinds.def index 539b659d63c..aa56be8bc88 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.def +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.def @@ -464,7 +464,7 @@ DIAG(err_ovl_surrogate_cand, NOTE, DIAG(err_member_call_without_object, ERROR, "call to non-static member function without an object argument") -/// C++ Templates Semantic Analysis +// C++ Template Declarations DIAG(err_template_param_shadow, ERROR, "declaration of %0 shadows template parameter") DIAG(note_template_param_here, NOTE, @@ -488,6 +488,26 @@ DIAG(err_template_nontype_parm_different_type, ERROR, DIAG(note_template_nontype_parm_prev_declaration, NOTE, "previous non-type template parameter with type %0 is here") +// 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, + "template argument for non-type template parameter must be an expression") +DIAG(err_template_arg_nontype_ambig, ERROR, + "template argument for non-type template parameter is treated as type %0") +DIAG(err_template_arg_must_be_template, ERROR, + "template argument for template template parameter must be a template") +DIAG(err_template_arg_local_type, ERROR, + "template argument uses local type %0") +DIAG(err_template_arg_unnamed_type, ERROR, + "template argument uses unnamed type") +DIAG(note_template_unnamed_type_here, NOTE, + "unnamed type used in template argument was declared here") + DIAG(err_unexpected_typedef, ERROR, "unexpected type name %0: expected expression") DIAG(err_unexpected_namespace, ERROR, diff --git a/clang/include/clang/Parse/Action.h b/clang/include/clang/Parse/Action.h index 14b2cea81af..efa94a2dc7d 100644 --- a/clang/include/clang/Parse/Action.h +++ b/clang/include/clang/Parse/Action.h @@ -1134,8 +1134,10 @@ public: /// new class template specialization. virtual TypeTy * ActOnClassTemplateSpecialization(DeclTy *Template, + SourceLocation TemplateLoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgs, + SourceLocation *TemplateArgLocs, SourceLocation RAngleLoc, const CXXScopeSpec *SS = 0) { return 0; diff --git a/clang/include/clang/Parse/Ownership.h b/clang/include/clang/Parse/Ownership.h index f191d9a3b40..cae8815ab06 100644 --- a/clang/include/clang/Parse/Ownership.h +++ b/clang/include/clang/Parse/Ownership.h @@ -567,7 +567,7 @@ namespace clang #endif Args(Other.Args), ArgIsType(Other.ArgIsType), Count(Other.Count) { #if !defined(DISABLE_SMART_POINTERS) - Other.destroy(); + Other.Count = 0; #endif } diff --git a/clang/include/clang/Parse/Parser.h b/clang/include/clang/Parse/Parser.h index 64b2f134e85..2d777ff7ba2 100644 --- a/clang/include/clang/Parse/Parser.h +++ b/clang/include/clang/Parse/Parser.h @@ -1007,10 +1007,12 @@ private: // C++ 14.3: Template arguments [temp.arg] typedef llvm::SmallVector<void *, 16> TemplateArgList; typedef llvm::SmallVector<bool, 16> TemplateArgIsTypeList; + typedef llvm::SmallVector<SourceLocation, 16> TemplateArgLocationList; void AnnotateTemplateIdToken(DeclTy *Template, TemplateNameKind TNK, const CXXScopeSpec *SS = 0); bool ParseTemplateArgumentList(TemplateArgList &TemplateArgs, - TemplateArgIsTypeList &TemplateArgIsType); + TemplateArgIsTypeList &TemplateArgIsType, + TemplateArgLocationList &TemplateArgLocations); void *ParseTemplateArgument(bool &ArgIsType); //===--------------------------------------------------------------------===// |

