mirror of
https://github.com/google/styleguide.git
synced 2024-03-22 13:11:43 +08:00
Fix false positive alarms on missed <algortihm> or <utility> header.
The case of a non-STL realization of the one of the functions under test that is called via class name/namespace resolution syntax (e.g. type type::min) was not handled by the RE.
This commit is contained in:
parent
b282a74fea
commit
b57fed5dda
6
cpplint/cpplint.py
vendored
6
cpplint/cpplint.py
vendored
|
@ -5320,10 +5320,10 @@ _RE_PATTERN_STRING = re.compile(r'\bstring\b')
|
|||
_re_pattern_headers_maybe_templates = []
|
||||
for _header, _templates in _HEADERS_MAYBE_TEMPLATES:
|
||||
for _template in _templates:
|
||||
# Match max<type>(..., ...), max(..., ...), but not foo->max, foo.max or
|
||||
# type::max().
|
||||
# Match max<type>(..., ...), max(..., ...), ::max(..., ...) but not
|
||||
# foo->max, foo.max or type::max().
|
||||
_re_pattern_headers_maybe_templates.append(
|
||||
(re.compile(r'[^>.]\b' + _template + r'(<.*?>)?\([^\)]'),
|
||||
(re.compile(r'[^>.](?<!\w::)\b' + _template + r'(<.*?>)?\([^\)]'),
|
||||
_template,
|
||||
_header))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user