[PATCH] D72217: [clang-tidy] Added readability-qualified-auto check

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 8 18:33:44 PST 2020


njames93 marked 2 inline comments as done and an inline comment as not done.
njames93 added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp:94-95
+  auto Pointee = QType.getTypePtr()->getPointeeType();
+  if (Pointee.isNull())
+    return Pointee.isLocalConstQualified();
+  return Pointee.isConstQualified();
----------------
njames93 wrote:
> njames93 wrote:
> > aaron.ballman wrote:
> > > Can you explain why this code is needed? If the pointee is null, there's been some sort of error, I believe.
> > > 
> > > I am not certain this function is needed, I think `QType->getPointeeType().isConstQualified()` likely suffices.
> > Well it kept crashing without that check so I need to do some more digging on that front 
> Figured it out, its when the type deduced from auto is a dependant template type, getting the desugarded type is working atm, but I dont know the ast well enough to be sure thats the correct method
I put in an assert check just for sanity reasons. but I have had no issues now I have updated slightly


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

https://reviews.llvm.org/D72217





More information about the cfe-commits mailing list