Add "typeid" in the exclusion list in CheckCStyleCast"

This commit is contained in:
Akira Okumura 2015-09-21 13:26:26 +02:00
parent 3591b2e540
commit e0702ae16a

2
cpplint/cpplint.py vendored
View File

@ -5357,7 +5357,7 @@ def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error):
# Exclude lines with keywords that tend to look like casts
context = line[0:match.start(1) - 1]
if Match(r'.*\b(?:sizeof|alignof|alignas|[_A-Z][_A-Z0-9]*)\s*$', context):
if Match(r'.*\b(?:sizeof|typeid|alignof|alignas|[_A-Z][_A-Z0-9]*)\s*$', context):
return False
# Try expanding current context to see if we one level of