diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-03-30 16:20:47 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-03-30 16:20:47 +0000 |
commit | 8b0fa5241a0416fc50dfbb7e38f20e777f191848 (patch) | |
tree | 1bce1e1579e3837bc13d69a9d807b6614c9b50ef /test/SemaTemplate/friend-template.cpp | |
parent | 49d26d2817180ccde605c987f79cd3a5b57639cd (diff) | |
download | clang-8b0fa5241a0416fc50dfbb7e38f20e777f191848.tar.gz |
If we encounter a friend class template for which we cannot resolve
the nested-name-specifier (e.g., because it is dependent), do not
error even though we can't represent it in the AST at this point.
This is a horrible, horrible hack. The actual feature we still need to
implement (for C++98!) is covered by PR12292. However, we used to
silently accept this code, so when we recently started rejecting it we
caused some regressions (e.g., <rdar://problem/11147355>). This hack
brings us back to the passable-but-not-good state we had previously.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153752 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/friend-template.cpp')
-rw-r--r-- | test/SemaTemplate/friend-template.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaTemplate/friend-template.cpp b/test/SemaTemplate/friend-template.cpp index 152df37d3d..9c95fa0151 100644 --- a/test/SemaTemplate/friend-template.cpp +++ b/test/SemaTemplate/friend-template.cpp @@ -230,3 +230,16 @@ namespace PR10660 { template <> friend class B; // expected-error{{extraneous 'template<>' in declaration of class 'B'}} }; } + +namespace rdar11147355 { + 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> class A<S>::B { + }; + + A<double>::B<double> ab; +} |