mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
fix: cpp domain parser cannot parse 'static constexpr' declarations. closes #1038
This commit is contained in:
@@ -852,7 +852,7 @@ class DefinitionParser(object):
|
|||||||
visibility = 'public'
|
visibility = 'public'
|
||||||
if self.match(_visibility_re):
|
if self.match(_visibility_re):
|
||||||
visibility = self.matched_text
|
visibility = self.matched_text
|
||||||
static = self.skip_word('static')
|
static = self.skip_word_and_ws('static')
|
||||||
return visibility, static
|
return visibility, static
|
||||||
|
|
||||||
def parse_type(self):
|
def parse_type(self):
|
||||||
|
|||||||
@@ -60,6 +60,9 @@ def test_type_definitions():
|
|||||||
x = 'constexpr int get_value()'
|
x = 'constexpr int get_value()'
|
||||||
assert unicode(parse('function', x)) == x
|
assert unicode(parse('function', x)) == x
|
||||||
|
|
||||||
|
x = 'static constexpr int get_value()'
|
||||||
|
assert unicode(parse('function', x)) == x
|
||||||
|
|
||||||
x = 'int get_value() const noexcept'
|
x = 'int get_value() const noexcept'
|
||||||
assert unicode(parse('function', x)) == x
|
assert unicode(parse('function', x)) == x
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user