summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-10-16 06:59:13 +0000
committerJohn McCall <rjmccall@apple.com>2010-10-16 06:59:13 +0000
commit2c2eb12d9c895b2174788f5068f106e5e933bbfc (patch)
treedb885535fc5fa507a44cee8d9783717cf82fa1d3 /clang/test
parent622581b73bf9466eaa79deb336613e42eef7d68d (diff)
downloadbcm5719-llvm-2c2eb12d9c895b2174788f5068f106e5e933bbfc.tar.gz
bcm5719-llvm-2c2eb12d9c895b2174788f5068f106e5e933bbfc.zip
White-listing templated-scope friend decls is a good idea, but doing it
by marking the decl invalid isn't. Make some steps towards supporting these and then hastily shut them down at the last second by marking them as unsupported. llvm-svn: 116661
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenCXX/template-instantiation.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/template-instantiation.cpp b/clang/test/CodeGenCXX/template-instantiation.cpp
index 47ff16b8a62..a8729035e28 100644
--- a/clang/test/CodeGenCXX/template-instantiation.cpp
+++ b/clang/test/CodeGenCXX/template-instantiation.cpp
@@ -92,3 +92,20 @@ namespace test3 {
// don't have key functions.
template void S<int>::m();
}
+
+namespace test4 {
+ template <class T> struct A { static void foo(); };
+
+ class B {
+ template <class T> friend void A<T>::foo();
+ B();
+ };
+
+ template <class T> void A<T>::foo() {
+ B b;
+ }
+
+ unsigned test() {
+ A<int>::foo();
+ }
+}
OpenPOWER on IntegriCloud