[PATCH] Fix UseAuto replacing declaration lists with new expressions

Ariel Bernal ariel.j.bernal at intel.com
Thu May 23 10:19:23 PDT 2013



================
Comment at: cpp11-migrate/UseAuto/UseAutoActions.cpp:128
@@ +127,3 @@
+        return;
+      const MemberPointerTypeLoc Q = cast<MemberPointerTypeLoc>(
+                                          V->getTypeSourceInfo()->getTypeLoc());
----------------
Edwin Vane wrote:
> I'm not sure how this even works. Should be using PointerTypeLoc not MemberPointerTypeLoc.
yes, it is PointerTypeLoc

================
Comment at: cpp11-migrate/UseAuto/UseAutoActions.cpp:80
@@ -79,1 +79,3 @@
 
+void removeStarsFromVarDecl(tooling::Replacements &Replace, SourceManager &SM,
+                                                  SourceLocation FirstStarLoc) {
----------------
Edwin Vane wrote:
> Instead of parsing, can we use Type and TypeLoc APIs to drill down through the pointers-to and call getStarLoc() on each PointerTypeLoc in the chain?
Yes, now using PointerTypeLoc, getNextTypeLoc returns the next star location.


http://llvm-reviews.chandlerc.com/D839



More information about the cfe-commits mailing list