[cfe-dev] Using clang-rename to move a class from the global namespace
Miklos Vajna via cfe-dev
cfe-dev at lists.llvm.org
Sun Mar 26 07:25:01 PDT 2017
Hi,
If I have this input:
----
class C;
class C {
public:
C();
~C();
void foo();
};
C::C() {}
C::~C() {}
void C::foo() {}
int main() {
C c;
c.foo();
return 0;
}
----
The actual result of "clang-rename -qualified-name=C -new-name=ns::C
test.cpp --" is:
----
class ns::C;
class ns::C {
public:
ns::C();
~ns::C();
void foo();
};
ns::C::ns::C() {}
ns::C::~ns::C() {}
void ns::C::foo() {}
int main() {
ns::C c;
c.foo();
return 0;
}
----
While I guess the expected output would be something like:
----
namespace ns {
class C;
}
namespace ns {
class C {
public:
C();
~C();
void foo();
};
}
ns::C::C() {}
ns::C::~C() {}
void ns::C::foo() {}
int main() {
ns::C c;
c.foo();
return 0;
}
----
My questions:
- Is such a "move a class from global namespace" change in-scope for
clang-rename? I'm asking, because if so, I would try to came up with
patches to improve the situation.
- I'm a bit confused if <https://reviews.llvm.org/D31176> is related to
the topic I bring up here or not. It sounds related by reading the
patch, but I can't be sure, since as the commit message says the
commandline behavior is so far unchanged.
Thanks,
Miklos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170326/db028c00/attachment.sig>
More information about the cfe-dev
mailing list