| @@ 6035-6051 (lines=17) @@ | ||
| 6032 | 'they may let you use it.') % top_name) |
|
| 6033 | ||
| 6034 | ||
| 6035 | def FlagCxx14Features(filename, clean_lines, linenum, error): |
|
| 6036 | """Flag those C++14 features that we restrict. |
|
| 6037 | ||
| 6038 | Args: |
|
| 6039 | filename: The name of the current file. |
|
| 6040 | clean_lines: A CleansedLines instance containing the file. |
|
| 6041 | linenum: The number of the line to check. |
|
| 6042 | error: The function to call with any errors found. |
|
| 6043 | """ |
|
| 6044 | line = clean_lines.elided[linenum] |
|
| 6045 | ||
| 6046 | include = Match(r'\s*#\s*include\s+[<"]([^<"]+)[">]', line) |
|
| 6047 | ||
| 6048 | # Flag unapproved C++14 headers. |
|
| 6049 | if include and include.group(1) in ('scoped_allocator', 'shared_mutex'): |
|
| 6050 | error(filename, linenum, 'build/c++14', 5, |
|
| 6051 | ('<%s> is an unapproved C++14 header.') % include.group(1)) |
|
| 6052 | ||
| 6053 | ||
| 6054 | def ProcessFileData(filename, file_extension, lines, error, |
|
| @@ 6035-6051 (lines=17) @@ | ||
| 6032 | 'they may let you use it.') % top_name) |
|
| 6033 | ||
| 6034 | ||
| 6035 | def FlagCxx14Features(filename, clean_lines, linenum, error): |
|
| 6036 | """Flag those C++14 features that we restrict. |
|
| 6037 | ||
| 6038 | Args: |
|
| 6039 | filename: The name of the current file. |
|
| 6040 | clean_lines: A CleansedLines instance containing the file. |
|
| 6041 | linenum: The number of the line to check. |
|
| 6042 | error: The function to call with any errors found. |
|
| 6043 | """ |
|
| 6044 | line = clean_lines.elided[linenum] |
|
| 6045 | ||
| 6046 | include = Match(r'\s*#\s*include\s+[<"]([^<"]+)[">]', line) |
|
| 6047 | ||
| 6048 | # Flag unapproved C++14 headers. |
|
| 6049 | if include and include.group(1) in ('scoped_allocator', 'shared_mutex'): |
|
| 6050 | error(filename, linenum, 'build/c++14', 5, |
|
| 6051 | ('<%s> is an unapproved C++14 header.') % include.group(1)) |
|
| 6052 | ||
| 6053 | ||
| 6054 | def ProcessFileData(filename, file_extension, lines, error, |
|