diff options
Diffstat (limited to 'clang-tools-extra')
-rw-r--r-- | clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp | 3 | ||||
-rw-r--r-- | clang-tools-extra/test/clang-tidy/google-readability-namespace-comments.cpp | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp b/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp index 8a13b5ba239..e57f736f0ea 100644 --- a/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp @@ -75,7 +75,8 @@ void NamespaceCommentCheck::check(const MatchFinder::MatchResult &Result) { 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)) diff --git a/clang-tools-extra/test/clang-tidy/google-readability-namespace-comments.cpp b/clang-tools-extra/test/clang-tidy/google-readability-namespace-comments.cpp index 1996552214f..4e381006ac2 100644 --- a/clang-tools-extra/test/clang-tidy/google-readability-namespace-comments.cpp +++ b/clang-tools-extra/test/clang-tidy/google-readability-namespace-comments.cpp @@ -26,3 +26,15 @@ namespace short2 { } } + +namespace n3 { + + + + + + + + + +}; // namespace n3 |