Commits

Takayuki Shimizukawa committed 6e6813e

fix: cpp domain parser cannot parse 'static constexpr' declarations. closes #1038

Comments (0)

Files changed (2)

sphinx/domains/cpp.py

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

tests/test_cpp_domain.py

     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