MCPcopy Index your code
hub / github.com/cpplint/cpplint / CheckMakePairUsesDeduction

Function CheckMakePairUsesDeduction

cpplint.py:7040–7062  ·  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

7038
7039
7040def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error):
7041 """Check that make_pair's template arguments are deduced.
7042
7043 G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are
7044 specified explicitly, and such use isn't intended in any case.
7045
7046 Args:
7047 filename: The name of the current file.
7048 clean_lines: A CleansedLines instance containing the file.
7049 linenum: The number of the line to check.
7050 error: The function to call with any errors found.
7051 """
7052 line = clean_lines.elided[linenum]
7053 match = _RE_PATTERN_EXPLICIT_MAKEPAIR.search(line)
7054 if match:
7055 error(
7056 filename,
7057 linenum,
7058 "build/explicit_make_pair",
7059 4, # 4 = high confidence
7060 "For C++11-compatibility, omit template arguments from make_pair"
7061 " OR use pair directly OR if appropriate, construct a pair directly",
7062 )
7063
7064
7065def CheckRedundantVirtual(filename, clean_lines, linenum, error):

Callers 1

ProcessLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected