cppfront
cppfront copied to clipboard
[BUG] using the using keyword inside a namespace with global functions results in code that does not compile
quick example for reproducing:
xf: () -> int = 42;
qq: namespace = {
using ::xf;
}
results in:
namespace qq {
using ::xf;
}
being declared before [[nodiscard]] auto xf() -> int;
which makes the code not compile due to cpp1 requiring ordering.
Of a Cpp2 function, its Cpp1 declaration. Of a Cpp2 non-expression alias, its Cpp1 declaration. Of a Cpp2 expression alias, its Cpp1 definition.
- according to this order it should work, maybe namespaces change the order, I didn't notice them mentioned in the list anywhere, because i'm aliasing the cpp2 function which should be forward declared before
Yeah, it doesn't mention namespaces.
I suppose they're implicit, since they're required anyways.
The comment is from months before using declarations (commit dd047033de5a691721069eb9ddb5b4f7892afa94).