mirror of
https://github.com/google/styleguide.git
synced 2024-03-22 13:11:43 +08:00
Merge 15bebb3a53502dbf58fcf785c5c72806d3ed6efb into 8487c083e1faecb1259be8a8873618cfdb69d33d
This commit is contained in:
commit
98773ed9ac
3
cpplint/cpplint.py
vendored
3
cpplint/cpplint.py
vendored
@ -4664,7 +4664,8 @@ def _GetTextInside(text, start_pattern):
|
||||
# >
|
||||
_RE_PATTERN_IDENT = r'[_a-zA-Z]\w*' # =~ [[:alpha:]][[:alnum:]]*
|
||||
_RE_PATTERN_TYPE = (
|
||||
r'(?:const\s+)?(?:typename\s+|class\s+|struct\s+|union\s+|enum\s+)?'
|
||||
r'(?:const\s+)?(?:typename\s+|class\s+|struct\s+|union\s+|enum\s+'
|
||||
r'|signed\s+|unsigned\s+)?'
|
||||
r'(?:\w|'
|
||||
r'\s*<(?:<(?:<[^<>]*>|[^<>])*>|[^<>])*>|'
|
||||
r'::)+')
|
||||
|
@ -2217,6 +2217,9 @@ class CpplintTest(CpplintTestBase):
|
||||
self.TestLint('istringstream& LogFunc(istringstream& s);', '')
|
||||
# Returning a non-const reference from a function is OK.
|
||||
self.TestLint('int& g();', '')
|
||||
# Passing signed or unsigned const references is OK.
|
||||
self.TestLint('void foo(const unsigned int& bar);', '');
|
||||
self.TestLint('void foo(const signed int& bar);', '');
|
||||
# Passing a const reference to a struct (using the struct keyword) is OK.
|
||||
self.TestLint('void foo(const struct tm& tm);', '')
|
||||
# Passing a const reference to a typename is OK.
|
||||
|
Loading…
x
Reference in New Issue
Block a user