A tool for changing surrouding namespaces of class/function definitions while keeping
references to types in the changed namespace correctly qualified by prepending
namespace specifiers before them.
Example: test.cc
namespace na {
class X {};
namespace nb {
class Y { X x; };
} // namespace nb
} // namespace naTo move the definition of class Y from namespace "na::nb" to "x::y", run:
clang-change-namespace --old_namespace "na::nb" \ --new_namespace "x::y" --file_pattern "test.cc" test.cc --
Output:
namespace na {
class X {};
} // namespace na
namespace x {
namespace y {
class Y { na::X x; };
} // namespace y
} // namespace x
You shouldn't dereference after a dyn_cast. Either null-check or use cast.