diff options
author | John McCall <rjmccall@apple.com> | 2010-10-20 05:44:58 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-10-20 05:44:58 +0000 |
commit | 4e2cbb28baa0342b51336e55c519cd06308c4df2 (patch) | |
tree | f8365629d6f55e06bb40b67e88b96816051c62b2 /test/CXX | |
parent | 9a632eaa0ee73e4db701a8df74e92909d1fa350e (diff) |
When matching template parameter lists to template-ids in a scope specifier
on a friend declaration, skip template-ids which do not depend on the
current parameter list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116911 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX')
-rw-r--r-- | test/CXX/temp/temp.decls/temp.friend/p1.cpp | 25 |
1 files changed, 25 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 5e5d7869ff..578de2952d 100644 --- a/test/CXX/temp/temp.decls/temp.friend/p1.cpp +++ b/test/CXX/temp/temp.decls/temp.friend/p1.cpp @@ -307,3 +307,28 @@ namespace test14 { template class B<int>; // expected-note {{in instantiation}} } + +namespace test15 { + template <class T> class B; + template <class T> class A { + friend void B<T>::foo(); + + // This shouldn't be misrecognized as a templated-scoped reference. + template <class U> friend void B<T>::bar(U); + + static void foo(); // expected-note {{declared private here}} + }; + + template <class T> class B { + void foo() { return A<long>::foo(); } // expected-error {{'foo' is a private member of 'test15::A<long>'}} + }; + + template <> class B<float> { + void foo() { return A<float>::foo(); } + template <class U> void bar(U u) { + (void) A<float>::foo(); + } + }; + + template class B<int>; // expected-note {{in instantiation}} +} |