The ElaboratedType can have no qualifiers, so we should check it before
use.
Fix #issue53874(https://github.com/llvm/llvm-project/issues/53874)
Differential D119949
[Clang-tidy] Check the existence of ElaboratedType's qualifiers junaire on Feb 16 2022, 8:03 AM. Authored by
Details The ElaboratedType can have no qualifiers, so we should check it before Fix #issue53874(https://github.com/llvm/llvm-project/issues/53874)
Diff Detail
Event TimelineComment Actions 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. Comment Actions 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 :-) Comment Actions Fix one nit and ship
|
Simplify to !BaseExpr->getType()->isTypedefNameType();