summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-02-10 03:28:10 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-02-10 03:28:10 +0000
commite8292b10a61adc03a8c0a3be47d3e39e0aa29b64 (patch)
tree223e8c3ae1aaa04b6f8c33b8d3940a1406a5533a /clang/test
parentc11b101fb64c621e6bc1a36904bc775ce6202beb (diff)
downloadbcm5719-llvm-e8292b10a61adc03a8c0a3be47d3e39e0aa29b64.tar.gz
bcm5719-llvm-e8292b10a61adc03a8c0a3be47d3e39e0aa29b64.zip
[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
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Modules/Inputs/cxx-lookup/module.modulemap2
-rw-r--r--clang/test/Modules/Inputs/cxx-lookup/na.h1
-rw-r--r--clang/test/Modules/Inputs/cxx-lookup/nb.h1
-rw-r--r--clang/test/Modules/cxx-lookup.cpp5
4 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/cxx-lookup/module.modulemap b/clang/test/Modules/Inputs/cxx-lookup/module.modulemap
index 6d397af250c..385c8c9b6f8 100644
--- a/clang/test/Modules/Inputs/cxx-lookup/module.modulemap
+++ b/clang/test/Modules/Inputs/cxx-lookup/module.modulemap
@@ -6,3 +6,5 @@ module C {
}
module X { header "x.h" export * }
module Y { header "y.h" export * }
+module na { header "na.h" export * }
+module nb { header "nb.h" export * }
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 00000000000..684d37e8a08
--- /dev/null
+++ b/clang/test/Modules/Inputs/cxx-lookup/na.h
@@ -0,0 +1 @@
+namespace N { struct S { friend struct foo; }; }
diff --git a/clang/test/Modules/Inputs/cxx-lookup/nb.h b/clang/test/Modules/Inputs/cxx-lookup/nb.h
new file mode 100644
index 00000000000..092c882c64d
--- /dev/null
+++ b/clang/test/Modules/Inputs/cxx-lookup/nb.h
@@ -0,0 +1 @@
+namespace N { extern int n; }
diff --git a/clang/test/Modules/cxx-lookup.cpp b/clang/test/Modules/cxx-lookup.cpp
index 47c879dbb63..bd019c7f4ae 100644
--- a/clang/test/Modules/cxx-lookup.cpp
+++ b/clang/test/Modules/cxx-lookup.cpp
@@ -4,3 +4,8 @@
namespace llvm {}
#include "c2.h"
llvm::GlobalValue *p;
+
+#include "na.h"
+namespace N { struct foo; }
+#include "nb.h"
+N::foo *use_n_foo;
OpenPOWER on IntegriCloud