[PATCH] D70974: [clang-tidy] Fix PR26274

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 5 03:16:33 PST 2019


alexfh added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp:79
+      } else { // Any other kind of token is unexpected here.
+        return llvm::None;
+      }
----------------
aaron.ballman wrote:
> How well do these test cases work?
> ```
> namespace [[]] {
> }
> 
> namespace frobble::inline bar {
> }
> ```
> I'm not certain what we want the comment to be for the second example, and I'm not certain the first example will parse properly here.
Both work correctly, in the second case the `inline` is dropped (why would we want it not to?). See clang-tools-extra/test/clang-tidy/checkers/google-readability-namespace-comments.cpp:66 and clang-tools-extra/test/clang-tidy/checkers/google-readability-namespace-comments-c++17.cpp:4 for tests covering very similar cases. Just in case, I've added a test with an empty attribute list.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70974/new/

https://reviews.llvm.org/D70974





More information about the cfe-commits mailing list