http://llvm.org/bugs/show_bug.cgi?id=10361 Fixes the following bug : inline namespace Outer { int i; inline namespace Inner { int i; } } void func() { i = 1; // expected-error, but clang chooses Outer::Inner::i }
The fix, which seems a little too simple, simply prevents NamedDecl::declarationReplaces(oldDecl) from replacing declarations if they actually live in different namespaces. I am not sure if this is enough, but it passes all my tests, and breaks none of the older ones. Also, I am not sure if I need to double check if one of the namespaces is truly nested in the other - at first glance, the check seems unnecessary - but I could be wrong. Thanks in advance for reviewing! Faisal Vali
ambiguous-inline-namespaces-names.patch
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
