The following program gives no error when compiling with clang:
namespace X {
struct i {};
}
namespace Y {
using X::i;
struct i {};
}
int main() {}
Let's use int instead of struct, then we get:
namespace X {
int i;
}
namespace Y {
using X::i;
int i;
}
int main() {}
This program gives a redefinition error when compiling with clang.
The only difference between the programs is the kind of entity used (struct or int), but one compiles without errors and the other gives a redefinition error.
Does this indicate a bug in clang? Maybe the standard is ambiguous what a redefinition is when it comes to using-declarations. But shouldn't a compiler make its interpretation consistently?
The programs can be compiled here: