diff options
| author | shimizukawa <shimizukawa@gmail.com> | 2012-11-28 15:49:06 +0900 |
|---|---|---|
| committer | shimizukawa <shimizukawa@gmail.com> | 2012-11-28 15:49:06 +0900 |
| commit | 4eca27e2f8e6f69a57ff3f6c2c5c8908ae199e95 (patch) | |
| tree | 01f7ed48881d490f3d2eb5f19c53353c042143a4 | |
| parent | e26f6807079e2b2e9f30a47425977489ca661087 (diff) | |
| download | sphinx-4eca27e2f8e6f69a57ff3f6c2c5c8908ae199e95.tar.gz | |
fix: cpp domain parser cannot parse 'static constexpr' declarations. closes #1038
| -rw-r--r-- | sphinx/domains/cpp.py | 2 | ||||
| -rw-r--r-- | tests/test_cpp_domain.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index 31daa1f6..6c18b1f6 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -852,7 +852,7 @@ class DefinitionParser(object): visibility = 'public' if self.match(_visibility_re): visibility = self.matched_text - static = self.skip_word('static') + static = self.skip_word_and_ws('static') return visibility, static def parse_type(self): diff --git a/tests/test_cpp_domain.py b/tests/test_cpp_domain.py index bd8aafa7..dae91aed 100644 --- a/tests/test_cpp_domain.py +++ b/tests/test_cpp_domain.py @@ -60,6 +60,9 @@ def test_type_definitions(): x = 'constexpr int get_value()' assert unicode(parse('function', x)) == x + x = 'static constexpr int get_value()' + assert unicode(parse('function', x)) == x + x = 'int get_value() const noexcept' assert unicode(parse('function', x)) == x |
