diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-02-18 07:07:28 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-02-18 07:07:28 +0000 |
commit | 965acbb321e94e36aa5365126eee46b97745fdbb (patch) | |
tree | b90c16f0aedbfca9146e07251c896cd22d9fd9c6 /lib/Parse/DeclSpec.cpp | |
parent | c6c16af963eddc3e9b75b5d2614d069e1162fe27 (diff) |
Allow "overloadable" functions in C to be declared as variadic without
any named parameters, e.g., this is accepted in C:
void f(...) __attribute__((overloadable));
although this would be rejected:
void f(...);
To do this, moved the checking of the "ellipsis without any named
arguments" condition from the parser into Sema (where it belongs anyway).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64902 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/DeclSpec.cpp')
-rw-r--r-- | lib/Parse/DeclSpec.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Parse/DeclSpec.cpp b/lib/Parse/DeclSpec.cpp index 4f1ef2490a..28c8149639 100644 --- a/lib/Parse/DeclSpec.cpp +++ b/lib/Parse/DeclSpec.cpp @@ -27,6 +27,7 @@ static DiagnosticBuilder Diag(Diagnostic &D, SourceLocation Loc, /// DeclaratorChunk::getFunction - Return a DeclaratorChunk for a function. /// "TheDeclarator" is the declarator that this will be added to. DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto, bool isVariadic, + SourceLocation EllipsisLoc, ParamInfo *ArgInfo, unsigned NumArgs, unsigned TypeQuals, @@ -37,6 +38,7 @@ DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto, bool isVariadic, I.Loc = Loc; I.Fun.hasPrototype = hasProto; I.Fun.isVariadic = isVariadic; + I.Fun.EllipsisLoc = EllipsisLoc.getRawEncoding(); I.Fun.DeleteArgInfo = false; I.Fun.TypeQuals = TypeQuals; I.Fun.NumArgs = NumArgs; |