Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -5941,7 +5941,7 @@ def ExpectingFunctionArgs(clean_lines, linenum):
# Match max<type>(..., ...), 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'((\bstd::)|[^>.:])\b' + _template + r'(<.*?>)?\([^\)]'),
_template,
_header))
# Match set<type>, but not foo->set<type>, foo.set<type>
Expand Down
7 changes: 6 additions & 1 deletion cpplint_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,12 @@ def testIncludeWhatYouUse(self):
'[build/include_what_you_use] [4]')
self.TestIncludeWhatYouUse(
"""#include "base/foobar.h"
bool foobar = min_element(a.begin(), a.end());
boost::range::transform(input, std::back_inserter(output), square);
""",
'') # Avoid false positives on transform in other namespaces.
self.TestIncludeWhatYouUse(
"""#include "base/foobar.h"
bool foobar = std::min_element(a.begin(), a.end());
""",
'Add #include <algorithm> for min_element '
'[build/include_what_you_use] [4]')
Expand Down