mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add new `duplicate_declaration.{c,cpp}
` warning types (#13173)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
This commit is contained in:
parent
504eecada8
commit
fddbd7d151
@ -18,6 +18,10 @@ Deprecated
|
||||
Features added
|
||||
--------------
|
||||
|
||||
* Add a new ``duplicate_declaration`` warning type,
|
||||
with ``duplicate_declaration.c`` and ``duplicate_declaration.cpp`` subtypes.
|
||||
Patch by Julien Lecomte and Adam Turner.
|
||||
|
||||
Bugs fixed
|
||||
----------
|
||||
|
||||
|
@ -1374,6 +1374,8 @@ Options for warning control
|
||||
* ``config.cache``
|
||||
* ``docutils``
|
||||
* ``download.not_readable``
|
||||
* ``duplicate_declaration.c``
|
||||
* ``duplicate_declaration.cpp``
|
||||
* ``epub.unknown_project_files``
|
||||
* ``epub.duplicated_toc_entry``
|
||||
* ``i18n.inconsistent_references``
|
||||
@ -1444,6 +1446,9 @@ Options for warning control
|
||||
.. versionadded:: 8.0
|
||||
Added ``misc.copy_overwrite``.
|
||||
|
||||
.. versionadded:: 8.2
|
||||
Added ``duplicate_declaration.c`` and ``duplicate_declaration.cpp``.
|
||||
|
||||
|
||||
Builder options
|
||||
===============
|
||||
|
@ -284,6 +284,8 @@ class CObject(ObjectDescription[ASTDeclaration]):
|
||||
self.display_object_type,
|
||||
sig,
|
||||
location=signode,
|
||||
type='duplicate_declaration',
|
||||
subtype='c',
|
||||
)
|
||||
|
||||
if ast.objectType == 'enumerator':
|
||||
|
@ -548,6 +548,8 @@ class Symbol:
|
||||
our_child.declaration.directiveType,
|
||||
name,
|
||||
location=(other_child.docname, other_child.line),
|
||||
type='duplicate_declaration',
|
||||
subtype='c',
|
||||
)
|
||||
else:
|
||||
# Both have declarations, and in the same docname.
|
||||
|
@ -397,6 +397,8 @@ class CPPObject(ObjectDescription[ASTDeclaration]):
|
||||
self.display_object_type,
|
||||
sig,
|
||||
location=signode,
|
||||
type='duplicate_declaration',
|
||||
subtype='cpp',
|
||||
)
|
||||
|
||||
if ast.objectType == 'enumerator':
|
||||
|
@ -895,6 +895,8 @@ class Symbol:
|
||||
our_child.declaration.directiveType,
|
||||
name,
|
||||
location=(other_child.docname, other_child.line),
|
||||
type='duplicate_declaration',
|
||||
subtype='cpp',
|
||||
)
|
||||
else:
|
||||
our_object_type = our_child.declaration.objectType
|
||||
|
Loading…
Reference in New Issue
Block a user