summaryrefslogtreecommitdiff
path: root/test/CXX/temp/temp.decls
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-07-10 22:04:13 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-07-10 22:04:13 +0000
commit433a13d0cdb1c48b828fe5bfb6a835c58e1e758b (patch)
tree391e5d3a5da684f96b03f3f1238447d16e78a1a2 /test/CXX/temp/temp.decls
parent07b1bbe648a21b8cdbc073fb6a409422c49921bb (diff)
downloadclang-433a13d0cdb1c48b828fe5bfb6a835c58e1e758b.tar.gz
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/temp/temp.decls')
-rw-r--r--test/CXX/temp/temp.decls/temp.friend/p4.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CXX/temp/temp.decls/temp.friend/p4.cpp b/test/CXX/temp/temp.decls/temp.friend/p4.cpp
index e036cef32b..8571a14120 100644
--- a/test/CXX/temp/temp.decls/temp.friend/p4.cpp
+++ b/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);
+}