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 74605a6 commit 8798a76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions cpplint/cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -3951,6 +3951,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/cpplint_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2534,6 +2534,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 8798a76

Please sign in to comment.