summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/temp/temp.decls/temp.friend/p4.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-07-17 23:53:16 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-07-17 23:53:16 +0000
commit6401768ac4565a43dbe09e096360be8594ad30e7 (patch)
tree9eaa75c75e61d3d23a262b22a8c356ddc80eeb48 /clang/test/CXX/temp/temp.decls/temp.friend/p4.cpp
parentf05d6c784373c30740eda1fb0f1ce5e6790e7f35 (diff)
downloadbcm5719-llvm-6401768ac4565a43dbe09e096360be8594ad30e7.tar.gz
bcm5719-llvm-6401768ac4565a43dbe09e096360be8594ad30e7.zip
Reinstate r186040, with additional fixes and more test coverage (reverted in
r186331). Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186546
Diffstat (limited to 'clang/test/CXX/temp/temp.decls/temp.friend/p4.cpp')
-rw-r--r--clang/test/CXX/temp/temp.decls/temp.friend/p4.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/CXX/temp/temp.decls/temp.friend/p4.cpp b/clang/test/CXX/temp/temp.decls/temp.friend/p4.cpp
index e036cef32b2..8571a141201 100644
--- a/clang/test/CXX/temp/temp.decls/temp.friend/p4.cpp
+++ b/clang/test/CXX/temp/temp.decls/temp.friend/p4.cpp
@@ -26,3 +26,20 @@ void g() {
X2<float> xf;
f(xf);
}
+
+template<typename T>
+struct X3 {
+ operator int();
+
+ friend void h(int x);
+};
+
+int array2[sizeof(X3<int>)];
+int array3[sizeof(X3<float>)];
+
+void i() {
+ X3<int> xi;
+ h(xi);
+ X3<float> xf;
+ h(xf);
+}
OpenPOWER on IntegriCloud