Skip to content

Commit

Permalink
fix: google#752 cpplint false positive [readability/braces] with requ…
Browse files Browse the repository at this point in the history
…ires expression (C++20)
  • Loading branch information
martinzink committed Jan 12, 2023
1 parent fa12a0b commit c5011b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -4465,6 +4465,7 @@ def CheckTrailingSemicolon(filename, clean_lines, linenum, error):
(func and not Search(r'\boperator\s*\[\s*\]', func.group(1))) or
Search(r'\b(?:struct|union)\s+alignas\s*$', line_prefix) or
Search(r'\bdecltype$', line_prefix) or
Search(r'\brequires$', line_prefix) or
Search(r'\s+=\s*$', line_prefix)):
match = None
if (match and
Expand Down
1 change: 1 addition & 0 deletions cpplint_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2697,6 +2697,7 @@ def testSemiColonAfterBraces(self):
self.TestLint('class X : public Y {};', '')
self.TestLint('class X : public MACRO() {};', '')
self.TestLint('class X : public decltype(expr) {};', '')
self.TestLint('concept Addable = requires(T x) { x + x; };', '')
self.TestLint('DEFINE_FACADE(PCQueue::Watcher, PCQueue) {};', '')
self.TestLint('VCLASS(XfaTest, XfaContextTest) {};', '')
self.TestLint('class STUBBY_CLASS(H, E) {};', '')
Expand Down

0 comments on commit c5011b9

Please sign in to comment.