diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Basic/DiagnosticParseKinds.def | 2 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.def | 3 | ||||
-rw-r--r-- | include/clang/Parse/DeclSpec.h | 13 |
3 files changed, 13 insertions, 5 deletions
diff --git a/include/clang/Basic/DiagnosticParseKinds.def b/include/clang/Basic/DiagnosticParseKinds.def index 5134a28185..6d87c70a17 100644 --- a/include/clang/Basic/DiagnosticParseKinds.def +++ b/include/clang/Basic/DiagnosticParseKinds.def @@ -162,8 +162,6 @@ DIAG(err_illegal_decl_reference_to_reference, ERROR, "%0 declared as a reference to a reference") DIAG(err_argument_required_after_attribute, ERROR, "argument required after attribute") -DIAG(err_ellipsis_first_arg, ERROR, - "ISO C requires a named argument before '...'") DIAG(err_missing_param, ERROR, "expected parameter declarator") DIAG(err_unexpected_typedef_ident, ERROR, diff --git a/include/clang/Basic/DiagnosticSemaKinds.def b/include/clang/Basic/DiagnosticSemaKinds.def index 16692412dc..fc4bfc9ad2 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.def +++ b/include/clang/Basic/DiagnosticSemaKinds.def @@ -78,7 +78,8 @@ DIAG(warn_decl_in_param_list, WARNING, "declaration of %0 will not be visible outside of this function") DIAG(warn_implicit_function_decl, WARNING, "implicit declaration of function %0") - +DIAG(err_ellipsis_first_arg, ERROR, + "ISO C requires a named argument before '...'") DIAG(err_declarator_need_ident, ERROR, "declarator requires an identifier") DIAG(err_bad_language, ERROR, diff --git a/include/clang/Parse/DeclSpec.h b/include/clang/Parse/DeclSpec.h index 4879f00be7..118d6a246e 100644 --- a/include/clang/Parse/DeclSpec.h +++ b/include/clang/Parse/DeclSpec.h @@ -503,10 +503,14 @@ struct DeclaratorChunk { /// and is treated as a K&R-style function. bool hasPrototype : 1; - /// isVariadic - If this function has a prototype, and if that proto ends - /// with ',...)', this is true. + /// isVariadic - If this function has a prototype, and if that + /// proto ends with ',...)', this is true. When true, EllipsisLoc + /// contains the location of the ellipsis. bool isVariadic : 1; + /// When isVariadic is true, the location of the ellipsis in the source. + unsigned EllipsisLoc; + /// The type qualifiers: const/volatile/restrict. /// The qualifier bitmask values are the same as in QualType. unsigned TypeQuals : 3; @@ -537,6 +541,10 @@ struct DeclaratorChunk { if (DeleteArgInfo) delete[] ArgInfo; } + + SourceLocation getEllipsisLoc() const { + return SourceLocation::getFromRawEncoding(EllipsisLoc); + } }; struct BlockPointerTypeInfo { @@ -646,6 +654,7 @@ struct DeclaratorChunk { /// DeclaratorChunk::getFunction - Return a DeclaratorChunk for a function. /// "TheDeclarator" is the declarator that this will be added to. static DeclaratorChunk getFunction(bool hasProto, bool isVariadic, + SourceLocation EllipsisLoc, ParamInfo *ArgInfo, unsigned NumArgs, unsigned TypeQuals, SourceLocation Loc, Declarator &TheDeclarator); |