================
@@ -0,0 +1,155 @@
+======================
+Clang-Change-Namespace
+======================
+
+.. contents::
+
+.. toctree::
+  :maxdepth: 1
+
+:program:`clang-change-namespace` can be used to change the surrounding
+namespaces of class/function definitions.
+
+Classes/functions in the moved namespace will have new namespaces while
+references to symbols (e.g. types, functions) which are not defined in the
+changed namespace will be correctly qualified by prepending namespace 
specifiers
+before them. This will try to add shortest namespace specifiers possible.
+
+When a symbol reference needs to be fully-qualified, this adds a `::` prefix to
+the namespace specifiers unless the new namespace is the global namespace. For
----------------
AaronBallman wrote:

I'm not certain I understand this. Is this saying:
```
  namespace a {
  class A {
  };    
  } // namespace a

  a::A thing;
```
with
```
  clang-change-namespace \
    --old_namespace "a" \
    --new_namespace "" \
    --file_pattern "test.cc" \
    --i \
    test.cc
```
will produce `A thing;` but
```
  clang-change-namespace \
    --old_namespace "a" \
    --new_namespace "foo" \
    --file_pattern "test.cc" \
    --i \
    test.cc
```
will produce `::foo::A thing;`?

https://github.com/llvm/llvm-project/pull/148277
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to