[PATCH] D119949: [Clang-tidy] Check the existence of ElaboratedType's qualifiers

Jun Zhang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 16 23:08:46 PST 2022


junaire added a comment.

In D119949#3328254 <https://reviews.llvm.org/D119949#3328254>, @cloudhan wrote:

> As the original bug reporter, I don't think this is a proper fix for it. There seems to be some kind of bug deep in the frontend. This just hide it anyway.

Yeah, maybe there's a deeper issue need to be dug into. I just found the code below doesn't work as well:

  namespace N {
  
  struct S{
          static int i;
  } s;
  }
  
  int main()
  {
          return N::s.i;
  }

Without this fix, clang-tidy will crash, but after applying this patch, clang-tidy gives the wrong fixhint:

  /home/jun/workground/demo.cpp:10:9: warning: static member accessed through instance [readability-static-accessed-through-instance]
          return N::s.i;
                 ^~~~~
                 struct S::
        // should be N::S::

I will try to look into this issue, any comments about it are welcome :-)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119949



More information about the cfe-commits mailing list