diff options
author | Roland Levillain <rpl@google.com> | 2015-01-21 18:25:13 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-01-21 18:25:14 +0000 |
commit | 59add47cabce3735ccd470cd3b5dac8b112e09ab (patch) | |
tree | 30fcb2f0aba75dc347438ba068418cb18756e543 /tools | |
parent | 9dec5a74014e96d41f84373990b4d4ac83206a88 (diff) | |
parent | a21f81e6dd28184feabc6816a4d2b0588ee5aa74 (diff) | |
download | android_art-59add47cabce3735ccd470cd3b5dac8b112e09ab.tar.gz android_art-59add47cabce3735ccd470cd3b5dac8b112e09ab.tar.bz2 android_art-59add47cabce3735ccd470cd3b5dac8b112e09ab.zip |
Merge "Allow std::function<return_type(arg_type)> patterns in cpplint."
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/cpplint.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/cpplint.py b/tools/cpplint.py index c2f6514c2b..4f063d931c 100755 --- a/tools/cpplint.py +++ b/tools/cpplint.py @@ -3227,9 +3227,16 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state, # virtually indistinguishable from int(x) casts. Likewise, gMock's # MockCallback takes a template parameter of the form return_type(arg_type), # which looks much like the cast we're trying to detect. + # BEGIN android-added + # The C++ 2011 std::function class template exhibits a similar issue. + # END android-added if (match.group(1) is None and # If new operator, then this isn't a cast not (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or - Match(r'^\s*MockCallback<.*>', line))): + # BEGIN android-changed + # Match(r'^\s*MockCallback<.*>', line))): + Match(r'^\s*MockCallback<.*>', line) or + Match(r'^\s*std::function<.*>', line))): + # END android-changed # Try a bit harder to catch gmock lines: the only place where # something looks like an old-style cast is where we declare the # return type of the mocked method, and the only time when we |