[PATCH] Fix UseAuto not transforming iterators when non-fully qualified names are used and libc++.

Ariel Bernal ariel.j.bernal at intel.com
Thu Jul 11 08:35:39 PDT 2013

Comment at: cpp11-migrate/UseAuto/UseAutoMatchers.cpp:175
@@ +174,3 @@
+///   matches "using std::vector" and "using ns::list".
+AST_MATCHER(Decl, isFromStdNamespace) {
+  const DeclContext *D = Node.getDeclContext();
Edwin Vane wrote:
> This is duplicated from Replace auto_ptr transform. Can we put this in a header in Core instead and use it from both transforms?
yes sure

Comment at: cpp11-migrate/UseAuto/UseAutoMatchers.cpp:237
@@ -210,3 +236,3 @@
Edwin Vane wrote:
> Guillaume Papin wrote:
> > I'm not sure if this part is still needed but I don't think it hurts either.
> I'd try removing it and see if tests pass.
no need for this, its covered by isFromStdNamespace. In fact isFromStdNamespace is more general since hasPrefix is false if std is not specified as part of the type.

Comment at: test/cpp11-migrate/UseAuto/Inputs/test_std_container.h:66
@@ -65,2 +65,3 @@
+inline namespace _1 {
Edwin Vane wrote:
> I'm tempted to say to just use `#ifdef USE_INLINE_NAMESPACE` so you don't need `-D...=1`.
I have no preference but below we have #if USE_BASE_CLASS_ITERATORS so I think we should use either one or the other.


More information about the cfe-commits mailing list