summaryrefslogtreecommitdiff
path: root/test/SemaTemplate
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-11-08 18:59:56 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-11-08 18:59:56 +0000
commitce6426feda94ca716ee7743b71961850740eb08d (patch)
treefcc3a60f1543d705712d36f4f384aa4fd4729c27 /test/SemaTemplate
parentc2e0329c8b84b16252184db4dd575c9e9fb93efe (diff)
downloadclang-ce6426feda94ca716ee7743b71961850740eb08d.tar.gz
Issue a diagnostic if we see a templated friend declaration that we do not
support. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194273 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r--test/SemaTemplate/friend-template.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/test/SemaTemplate/friend-template.cpp b/test/SemaTemplate/friend-template.cpp
index 8a478777eb..e9b2b9b8e6 100644
--- a/test/SemaTemplate/friend-template.cpp
+++ b/test/SemaTemplate/friend-template.cpp
@@ -232,16 +232,23 @@ namespace PR10660 {
}
namespace rdar11147355 {
- template <class T>
+ template <class T>
struct A {
template <class U> class B;
- template <class S> template <class U> friend class A<S>::B;
+ template <class S> template <class U> friend class A<S>::B; // expected-warning {{dependent nested name specifier 'A<S>::' for friend template declaration is not supported; ignoring this friend declaration}}
+ private:
+ int n; // expected-note {{here}}
};
-
+
template <class S> template <class U> class A<S>::B {
- };
-
+ public:
+ // FIXME: This should be permitted.
+ int f(A<S*> a) { return a.n; } // expected-error {{private}}
+ };
+
A<double>::B<double> ab;
+ A<double*> a;
+ int k = ab.f(a); // expected-note {{instantiation of}}
}
namespace RedeclUnrelated {