Skip to content

Commit

Permalink
Teach the explicit constructor check about constexpr.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
danakj committed Feb 22, 2017
1 parent b282a74 commit cf4071c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpplint/cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cf4071c

Please sign in to comment.