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

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 4 07:58:28 PST 2019


gribozavr2 accepted this revision.
gribozavr2 added a comment.
This revision is now accepted and ready to land.

In D70974#1768902 <https://reviews.llvm.org/D70974#1768902>, @aaron.ballman wrote:

> In D70974#1768871 <https://reviews.llvm.org/D70974#1768871>, @gribozavr2 wrote:
>
> > I'm not convinced this feature is worth implementing at all, because there's a good alternative to a macro here -- a namespace alias. What is the reason to use a macro instead of a namespace alias?
>
>
> While I think that's a superior solution to using macros, some users have macros instead. This fixes a bug reported in https://bugs.llvm.org/show_bug.cgi?id=26274 and I agree that the behavior described in that bug is not what I would expect it to be.


I mean, it is possible to break pretty much any ClangTidy check with sneaky code. But there's a limit to which we should try to make things work in tricky corner cases. For example, the fix in this patch does not handle function-like macros (`namespace MY_LIBRARY_NAMESPACE_FOR_VERSION(42) {`).

LGTM if we must... but I don't think we should.


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