[clang-tools-extra] r255772 - [clang-tidy] google-readability-namespace-comments: ignore stray semicolons

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 16 07:44:42 PST 2015


Author: alexfh
Date: Wed Dec 16 09:44:42 2015
New Revision: 255772

URL: http://llvm.org/viewvc/llvm-project?rev=255772&view=rev
Log:
[clang-tidy] google-readability-namespace-comments: ignore stray semicolons

Modified:
    clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-readability-namespace-comments.cpp

Modified: clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp?rev=255772&r1=255771&r2=255772&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp Wed Dec 16 09:44:42 2015
@@ -75,7 +75,8 @@ void NamespaceCommentCheck::check(const
   SourceLocation Loc = AfterRBrace;
   Token Tok;
   // Skip whitespace until we find the next token.
-  while (Lexer::getRawToken(Loc, Tok, Sources, Result.Context->getLangOpts())) {
+  while (Lexer::getRawToken(Loc, Tok, Sources, Result.Context->getLangOpts()) ||
+         Tok.is(tok::semi)) {
     Loc = Loc.getLocWithOffset(1);
   }
   if (!locationsInSameFile(Sources, ND->getRBraceLoc(), Loc))

Modified: clang-tools-extra/trunk/test/clang-tidy/google-readability-namespace-comments.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/google-readability-namespace-comments.cpp?rev=255772&r1=255771&r2=255772&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/google-readability-namespace-comments.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/google-readability-namespace-comments.cpp Wed Dec 16 09:44:42 2015
@@ -26,3 +26,15 @@ namespace short2 {
 
 }
 }
+
+namespace n3 {
+
+
+
+
+
+
+
+
+
+}; // namespace n3




More information about the cfe-commits mailing list