[modules] When determining whether a name from a module replaces a name we
already have, check whether the name from the module is actually newer than the
existing declaration. If it isn't, we might (say) replace a visible declaration
with an injected friend, and thus make it invisible (or lose a default argument
or an array bound).
llvm-svn: 228661
diff --git a/clang/test/Modules/Inputs/cxx-lookup/na.h b/clang/test/Modules/Inputs/cxx-lookup/na.h
new file mode 100644
index 0000000..684d37e
--- /dev/null
+++ b/clang/test/Modules/Inputs/cxx-lookup/na.h
@@ -0,0 +1 @@
+namespace N { struct S { friend struct foo; }; }