MCPcopy Index your code
hub / github.com/nodejs/node / CheckMakePairUsesDeduction

Function CheckMakePairUsesDeduction

tools/cpplint.py:7184–7206  ·  view source on GitHub ↗

Check that make_pair's template arguments are deduced. G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are specified explicitly, and such use isn't intended in any case. Args: filename: The name of the current file. clean_lines: A CleansedLines instance

(filename, clean_lines, linenum, error)

Source from the content-addressed store, hash-verified

7182
7183
7184def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error):
7185 """Check that make_pair's template arguments are deduced.
7186
7187 G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are
7188 specified explicitly, and such use isn't intended in any case.
7189
7190 Args:
7191 filename: The name of the current file.
7192 clean_lines: A CleansedLines instance containing the file.
7193 linenum: The number of the line to check.
7194 error: The function to call with any errors found.
7195 """
7196 line = clean_lines.elided[linenum]
7197 match = _RE_PATTERN_EXPLICIT_MAKEPAIR.search(line)
7198 if match:
7199 error(
7200 filename,
7201 linenum,
7202 "build/explicit_make_pair",
7203 4, # 4 = high confidence
7204 "For C++11-compatibility, omit template arguments from make_pair"
7205 " OR use pair directly OR if appropriate, construct a pair directly",
7206 )
7207
7208
7209def CheckRedundantVirtual(filename, clean_lines, linenum, error):

Callers 1

ProcessLineFunction · 0.85

Calls 2

errorFunction · 0.50
searchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…