Skip to content

Commit

Permalink
C++, fix role mismatch warnings for templateParam
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobandersen committed Jun 24, 2016
1 parent cc9f21c commit 4be597b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions sphinx/domains/cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4133,15 +4133,16 @@ def warn(self, msg):
def checkType():
if typ == 'any':
return True
elif typ == 'var' or typ == 'member':
return declTyp == 'var' or declTyp == 'member'
elif typ in ['enum', 'enumerator', 'class', 'function']:
if declTyp == 'templateParam':
return True
if typ == 'var' or typ == 'member':
return declTyp in ['var', 'member']
if typ in ['enum', 'enumerator', 'function', 'class']:
return declTyp == typ
elif typ == 'type':
if typ == 'type':
return declTyp in ['enum', 'class', 'function', 'type']
else:
print("Type is %s" % typ)
assert False
print("Type is %s" % typ)
assert False
if not checkType():
warner.warn("cpp:%s targets a %s." % (typ, s.declaration.objectType))

Expand Down

0 comments on commit 4be597b

Please sign in to comment.