From 71660ccdf1a55edc04bbee196ca4310334018a45 Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Thu, 18 Nov 2010 08:56:39 +1300 Subject: [PATCH] Account for arguments with only a type and no parameter name Previously, the code was parsing the type into the argname variable and then when it found something (not "," or ")") following the type it swapped the name into the type and parsed next part as the name. However, when no name is provided, as it allowed in c++, if you're not planning on using the parameter, or it is in a function declaration, then the actual type was being left in the name variable and the type variable was empty. As a result function signatures for references were being generated without knowledge of the type, which is the important factor in disambiguating overloaded functions. --- sphinx/domains/cpp.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index 53c92cd82..9906bd737 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -693,14 +693,13 @@ class DefinitionParser(object): self.fail('expected comma between arguments') self.skip_ws() - argname = self._parse_type() - argtype = default = None + argtype = self._parse_type() + argname = default = None self.skip_ws() if self.skip_string('='): self.pos += 1 default = self._parse_default_expr() elif self.current_char not in ',)': - argtype = argname argname = self._parse_name() self.skip_ws() if self.skip_string('='):