diff options
author | John McCall <rjmccall@apple.com> | 2010-04-08 09:05:18 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-04-08 09:05:18 +0000 |
commit | af2094e7cecadf36667deb61a83587ffdd979bd3 (patch) | |
tree | 5ff432cdff32239bd62431a429dd09292c69c1ec /test | |
parent | 2b60513052e81f66f852b21226ab488f9ed88f1d (diff) |
Implement dependent friend function template specializations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100753 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CXX/temp/temp.decls/temp.friend/p1.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CXX/temp/temp.decls/temp.friend/p1.cpp b/test/CXX/temp/temp.decls/temp.friend/p1.cpp index c9dc5460a0..57c71027b6 100644 --- a/test/CXX/temp/temp.decls/temp.friend/p1.cpp +++ b/test/CXX/temp/temp.decls/temp.friend/p1.cpp @@ -216,3 +216,25 @@ namespace test9 { template class A<int>; // expected-note {{in instantiation}} } + +namespace test10 { + template <class T> class A; + template <class T> A<T> bar(const T*, const A<T>&); + template <class T> class A { + private: + void foo(); // expected-note {{declared private here}} + friend A bar<>(const T*, const A<T>&); + }; + + template <class T> A<T> bar(const T *l, const A<T> &r) { + A<T> l1; + l1.foo(); + + A<char> l2; + l2.foo(); // expected-error {{'foo' is a private member of 'test10::A<char>'}} + + return l1; + } + + template A<int> bar<int>(const int *, const A<int> &); // expected-note {{in instantiation}} +} |