Commits

Chris Pickel  committed 00ecba2

Support varargs in C++ function signatures.

  • Participants
  • Parent commits 89bfbde

Comments (0)

Files changed (2)

File sphinx/domains/cpp.py

                     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()

File tests/test_cpp_domain.py

     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