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)
| 7182 | |
| 7183 | |
| 7184 | def 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 | |
| 7209 | def CheckRedundantVirtual(filename, clean_lines, linenum, error): |
no test coverage detected
searching dependent graphs…