mirror of
https://github.com/google/styleguide.git
synced 2024-03-22 13:11:43 +08:00
Teach the explicit constructor check about constexpr.
If a constructor is marked constexpr it evades the explicit constructor check right now, since the check only knows about the inline keyword. Teach it that constexpr can be used also.
This commit is contained in:
parent
b282a74fea
commit
cf4071cf5d
3
cpplint/cpplint.py
vendored
3
cpplint/cpplint.py
vendored
|
@ -2779,7 +2779,8 @@ def CheckForNonStandardConstructs(filename, clean_lines, linenum,
|
|||
# Look for single-argument constructors that aren't marked explicit.
|
||||
# Technically a valid construct, but against style.
|
||||
explicit_constructor_match = Match(
|
||||
r'\s+(?:inline\s+)?(explicit\s+)?(?:inline\s+)?%s\s*'
|
||||
r'\s+(?:(?:inline|constexpr)\s+)*(explicit\s+)?'
|
||||
r'(?:(?:inline|constexpr)\s+)*%s\s*'
|
||||
r'\(((?:[^()]|\([^()]*\))*)\)'
|
||||
% re.escape(base_classname),
|
||||
line)
|
||||
|
|
Loading…
Reference in New Issue
Block a user