mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00: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. Change-Id: Ia76ddd00b69c5a76a385d22a2b9eb18b690bd8c8 Reviewed-on: https://chromium-review.googlesource.com/445932 Reviewed-by: Robbie Iannucci <iannucci@chromium.org> Reviewed-by: Aaron Gable <agable@chromium.org> Commit-Queue: Aaron Gable <agable@chromium.org>
This commit is contained in:
3
cpplint.py
vendored
3
cpplint.py
vendored
@@ -2752,7 +2752,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)
|
||||
|
||||
Reference in New Issue
Block a user