mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
C++, support inline variables
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -53,6 +53,7 @@ Features added
|
||||
* #9097: Optimize the paralell build
|
||||
* #9131: Add :confval:`nitpick_ignore_regex` to ignore nitpicky warnings using
|
||||
regular expressions
|
||||
* C++, add support for inline variables.
|
||||
|
||||
|
||||
Bugs fixed
|
||||
|
||||
@@ -5957,12 +5957,13 @@ class DefinitionParser(BaseParser):
|
||||
if threadLocal:
|
||||
continue
|
||||
|
||||
if not inline and outer in ('function', 'member'):
|
||||
inline = self.skip_word('inline')
|
||||
if inline:
|
||||
continue
|
||||
|
||||
if outer == 'function':
|
||||
# function-specifiers
|
||||
if not inline:
|
||||
inline = self.skip_word('inline')
|
||||
if inline:
|
||||
continue
|
||||
if not friend:
|
||||
friend = self.skip_word('friend')
|
||||
if friend:
|
||||
|
||||
@@ -435,6 +435,8 @@ def test_domain_cpp_ast_member_definitions():
|
||||
# check('member', 'int b : (true ? 8 : a) = 42', {1: 'b__i', 2: '1b'})
|
||||
check('member', 'int b : 1 || new int{0}', {1: 'b__i', 2: '1b'})
|
||||
|
||||
check('member', 'inline int n', {1: 'n__i', 2: '1n'})
|
||||
|
||||
|
||||
def test_domain_cpp_ast_function_definitions():
|
||||
check('function', 'void f(volatile int)', {1: "f__iV", 2: "1fVi"})
|
||||
|
||||
Reference in New Issue
Block a user