[PATCH] D38284: [clang-tidy] Fix google-readability-namespace-comments handling of C++17 nested namespaces

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 13 07:24:23 PDT 2017


alexfh added inline comments.


================
Comment at: clang-tidy/readability/NamespaceCommentCheck.cpp:97
+  }
+  while (Lexer::getRawToken(LBracketLocation, Tok, Sources, getLangOpts()) ||
+         !Tok.is(tok::l_brace)) {
----------------
alexfh wrote:
> alexfh wrote:
> > alexfh wrote:
> > > The check started triggering an assertion failure and incredible slowness (infinite loops?) on some real files. I've not yet come up with an isolated test case, but all this seems to be happening around this loop.
> > > 
> > > I'm going to revert this revision. A bug report (and hopefully a test case ;) will follow.
> > > 
> > Reverted in r315580.
> Here's a test case that demonstrates the issue:
> ```
> #define MACRO macro_expansion
> namespace MACRO {
> void f(); // So that the namespace isn't empty.
> // 1
> // 2
> // 3
> // 4
> // 5
> // 6
> // 7
> // CHECK-MESSAGES: :[[@LINE+2]]:2: warning: namespace 'macro_expansion' not terminated with
> // CHECK-MESSAGES: :[[@LINE-10]]:11: note: namespace 'macro_expansion' starts here
> }
> // CHECK-FIXES: }  // namespace macro_expansion
> 
> ```
> 
> I'll commit it once Subversion on llvm.org starts working again.
Committed the regression test in r315682.


https://reviews.llvm.org/D38284





More information about the cfe-commits mailing list