MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / CheckMakePairUsesDeduction

Function CheckMakePairUsesDeduction

src/tests/coding/cpplint.py:6157–6175  ·  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 containing

(filename, clean_lines, linenum, error)

Source from the content-addressed store, hash-verified

6155
6156
6157def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error):
6158 """Check that make_pair's template arguments are deduced.
6159
6160 G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are
6161 specified explicitly, and such use isn't intended in any case.
6162
6163 Args:
6164 filename: The name of the current file.
6165 clean_lines: A CleansedLines instance containing the file.
6166 linenum: The number of the line to check.
6167 error: The function to call with any errors found.
6168 """
6169 line = clean_lines.elided[linenum]
6170 match = _RE_PATTERN_EXPLICIT_MAKEPAIR.search(line)
6171 if match:
6172 error(filename, linenum, 'build/explicit_make_pair',
6173 4, # 4 = high confidence
6174 'For C++11-compatibility, omit template arguments from make_pair'
6175 ' OR use pair directly OR if appropriate, construct a pair directly')
6176
6177
6178def CheckRedundantVirtual(filename, clean_lines, linenum, error):

Callers 1

ProcessLineFunction · 0.85

Calls 1

searchMethod · 0.80

Tested by

no test coverage detected