mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
C++, also support 'extern' for functions.
Thanks to Victor Zverovich.
This commit is contained in:
parent
68f3887428
commit
42395a177a
@ -91,8 +91,8 @@ from sphinx.util.docfields import Field, GroupedField
|
||||
decl-specifier ->
|
||||
storage-class-specifier ->
|
||||
( "static" (only for member_object and function_object)
|
||||
| "extern" (only for member_object and function_object)
|
||||
| "register"
|
||||
| "extern" (only for member_object)
|
||||
)
|
||||
thread_local[opt] (only for member_object)
|
||||
(it can also appear before the others)
|
||||
@ -3076,13 +3076,13 @@ class DefinitionParser(object):
|
||||
if self.skip_word('static'):
|
||||
storage = 'static'
|
||||
continue
|
||||
if self.skip_word('extern'):
|
||||
storage = 'extern'
|
||||
continue
|
||||
if outer == 'member':
|
||||
if self.skip_word('mutable'):
|
||||
storage = 'mutable'
|
||||
continue
|
||||
if self.skip_word('extern'):
|
||||
storage = 'extern'
|
||||
continue
|
||||
if self.skip_word('register'):
|
||||
storage = 'register'
|
||||
continue
|
||||
|
@ -261,6 +261,8 @@ def test_function_definitions():
|
||||
check("function", "void f(int *const p)", "f__iPC", "1fPCi")
|
||||
check("function", "void f(int *volatile const p)", "f__iPVC", "1fPVCi")
|
||||
|
||||
check('function', 'extern int f()', 'f', '1fv')
|
||||
|
||||
# TODO: make tests for functions in a template, e.g., Test<int&&()>
|
||||
# such that the id generation for function type types is correct.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user