mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
C++, fix templated operator bug
Fixes sphinx-doc/sphinx#2058 Fixes sphinx-doc/sphinx#2080
This commit is contained in:
parent
c823ffbcf1
commit
4e8f630176
@ -915,8 +915,6 @@ class ASTNestedName(ASTBase):
|
||||
assert len(names) > 0
|
||||
self.names = names
|
||||
self.rooted = rooted
|
||||
for i in range(len(names) - 1):
|
||||
assert not names[i].is_operator()
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
@ -2123,17 +2121,13 @@ class Symbol(object):
|
||||
s = s.parent
|
||||
symbols.reverse()
|
||||
key = []
|
||||
for s in symbols[:-1]:
|
||||
assert s.identifier
|
||||
nne = ASTNestedNameElement(s.identifier, s.templateArgs)
|
||||
for s in symbols:
|
||||
if s.identifier:
|
||||
nne = ASTNestedNameElement(s.identifier, s.templateArgs)
|
||||
else:
|
||||
assert s.declaration
|
||||
nne = s.declaration.name.names[-1]
|
||||
key.append((nne, s.templateParams))
|
||||
s = symbols[-1]
|
||||
if s.identifier:
|
||||
nne = ASTNestedNameElement(s.identifier, s.templateArgs)
|
||||
else:
|
||||
assert self.declaration
|
||||
nne = s.declaration.name.names[-1]
|
||||
key.append((nne, s.templateParams))
|
||||
return key
|
||||
|
||||
def get_full_nested_name(self):
|
||||
|
@ -304,6 +304,15 @@ def test_templates():
|
||||
"void allow(F *f, typename func<F, B, G!=1>::type tt)",
|
||||
None, "I0E5allowP1FN4funcI1F1BXG!=1EE4typeE")
|
||||
|
||||
# from #2058
|
||||
check('function',
|
||||
"template<typename Char, typename Traits> "
|
||||
"inline std::basic_ostream<Char, Traits> &operator<<("
|
||||
"std::basic_ostream<Char, Traits> &os, "
|
||||
"const c_string_view_base<const Char, Traits> &str)",
|
||||
None, "I00ElsRNSt13basic_ostreamI4Char6TraitsEE"
|
||||
"RK18c_string_view_baseIK4Char6TraitsE")
|
||||
|
||||
|
||||
def test_class():
|
||||
check('class', 'A final', 'A', '1A')
|
||||
|
Loading…
Reference in New Issue
Block a user