unterumarmung wrote:
> Can you talk about the motivation behind having the `OnlyNamespaceScope`
> option? Are there people who just don’t want fixes in classes/functions?
That is a great question. To be honest, I added `OnlyNamespaceScope` mostly on
vibes at first, not because I had a strict reason.
Following your question, that I dug into it and checked several public C++
style guides (Google, Chromium, Abseil, libc++, libstdc++, Boost, ClickHouse),
and I did not find a clear rule about this specific rewrite in class scope.
That said, I think there is still a real semantic difference. Inside a class,
`using X = Base::X;` creates a member alias (`Derived::X`), while `using
Base::X;` is more “bring a base member name into scope”.
```cpp
struct Base {
struct X {};
};
struct DerivedAlias : Base {
using X = Base::X;
};
struct DerivedUsingDecl : Base {
using Base::X;
};
```
This also has practical impact in Doxygen. In my local run (Doxygen 1.16.1),
the alias form generates a typedef member node in `struct_derived_alias.xml`
(`<memberdef kind="typedef">`, `<name>X</name>`,
`<qualifiedname>DerivedAlias::X</qualifiedname>`), and `index.xml` also lists
that member. The using-declaration form in `struct_derived_using_decl.xml` does
not generate an equivalent `<memberdef>` for `X`, so docs/anchors differ.
https://github.com/llvm/llvm-project/pull/180404
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits