diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index ea41f81c7..59d53463f 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -6044,7 +6044,7 @@ class CPPXRefRole(XRefRole): if not has_explicit_title: # major hax: replace anon names via simple string manipulation. # Can this actually fail? - title = _anon_identifier_re.sub("[anonymous]", title) + title = _anon_identifier_re.sub("[anonymous]", str(title)) if refnode['reftype'] == 'any': # Assume the removal part of fix_parens for :any: refs.