mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Support varargs in C++ function signatures.
This commit is contained in:
parent
3c2662580a
commit
7aef73271a
@ -712,6 +712,13 @@ class DefinitionParser(object):
|
||||
self.fail('expected comma between arguments')
|
||||
self.skip_ws()
|
||||
|
||||
if self.skip_string('...'):
|
||||
args.append(ArgumentDefExpr(None, '...', None))
|
||||
if self.skip_string(')'):
|
||||
break
|
||||
else:
|
||||
self.fail('expected closing parenthesis after ellipses')
|
||||
|
||||
argtype = self._parse_type()
|
||||
argname = default = None
|
||||
self.skip_ws()
|
||||
|
@ -37,6 +37,9 @@ def test_type_definitions():
|
||||
x = 'explicit module::myclass::foo::foo()'
|
||||
assert unicode(parse('function', x)) == x
|
||||
|
||||
x = 'int printf(const char* fmt, ...)'
|
||||
assert unicode(parse('function', x)) == x
|
||||
|
||||
x = 'std::vector<std::pair<std::string, long long>> module::blah'
|
||||
assert unicode(parse('type_object', x)) == x
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user