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)
| 5598 | |
| 5599 | |
| 5600 | def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error): |
| 5601 | """Check that make_pair's template arguments are deduced. |
| 5602 | |
| 5603 | G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are |
| 5604 | specified explicitly, and such use isn't intended in any case. |
| 5605 | |
| 5606 | Args: |
| 5607 | filename: The name of the current file. |
| 5608 | clean_lines: A CleansedLines instance containing the file. |
| 5609 | linenum: The number of the line to check. |
| 5610 | error: The function to call with any errors found. |
| 5611 | """ |
| 5612 | line = clean_lines.elided[linenum] |
| 5613 | match = _RE_PATTERN_EXPLICIT_MAKEPAIR.search(line) |
| 5614 | if match: |
| 5615 | error(filename, linenum, 'build/explicit_make_pair', |
| 5616 | 4, # 4 = high confidence |
| 5617 | 'For C++11-compatibility, omit template arguments from make_pair' |
| 5618 | ' OR use pair directly OR if appropriate, construct a pair directly') |
| 5619 | |
| 5620 | |
| 5621 | def CheckRedundantVirtual(filename, clean_lines, linenum, error): |