c++ - Redefinition inconsistency in clang between struct and int -
the following program gives no error when compiling clang:
namespace x { struct {}; } namespace y { using x::i; struct {}; } int main() {}
let's use int instead of struct, get:
namespace x { int i; } namespace y { using x::i; int i; } int main() {}
this program gives redefinition error when compiling clang.
the difference between programs kind of entity used (struct or int), 1 compiles without errors , other gives redefinition error.
does indicate bug in clang? maybe standard ambiguous redefinition when comes using-declarations. shouldn't compiler make interpretation consistently?
the programs can compiled here:
as igor tandetnik said, ill-formed due [basic.scope.declarative]/4 , there bug in clang.
the bug has been confirmed , fixed. see: https://llvm.org/bugs/show_bug.cgi?id=24033
Comments
Post a Comment