summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/class-template-decl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-11-02 17:38:53 +0000
committerDouglas Gregor <dgregor@apple.com>2011-11-02 17:38:53 +0000
commit8f5653a9991d388678e032e01efcab2637ce92ba (patch)
treef5a3e8b3fc51823492fcb09dc77520f53eaad32e /clang/test/SemaTemplate/class-template-decl.cpp
parent9d0eb8f9296df7f68cae05f7886fa5a73cde2574 (diff)
downloadbcm5719-llvm-8f5653a9991d388678e032e01efcab2637ce92ba.tar.gz
bcm5719-llvm-8f5653a9991d388678e032e01efcab2637ce92ba.zip
Drastically simplify the mapping from the declaration corresponding to
the injected-class-name of a class (or class template) to the declaration that results from substituting the given template arguments. Previously, we would actually perform a substitution into the injected-class-name type and then retrieve the resulting declaration. However, in certain, rare circumstances involving deeply-nested member templates, we would get the wrong substitution arguments. This new approach just matches up the declaration with a declaration that's part of the current context (or one of its parents), which will either be an instantiation (during template instantiation) or the declaration itself (during the definition of the template). This is both more efficient (we're avoiding a substitution) and more correct (we can't get the template arguments wrong in the member-template case). Fixes <rdar://problem/9676205>. llvm-svn: 143551
Diffstat (limited to 'clang/test/SemaTemplate/class-template-decl.cpp')
-rw-r--r--clang/test/SemaTemplate/class-template-decl.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/class-template-decl.cpp b/clang/test/SemaTemplate/class-template-decl.cpp
index 38b1778abf4..ec4e0163855 100644
--- a/clang/test/SemaTemplate/class-template-decl.cpp
+++ b/clang/test/SemaTemplate/class-template-decl.cpp
@@ -75,3 +75,23 @@ namespace PR8001 {
}
}
+namespace rdar9676205 {
+ template <unsigned, class _Tp> class tuple_element;
+
+ template <class _T1, class _T2> class pair;
+
+ template <class _T1, class _T2>
+ class tuple_element<0, pair<_T1, _T2> >
+ {
+ template <class _Tp>
+ struct X
+ {
+ template <class _Up, bool = X<_Up>::value>
+ struct Y
+ : public X<_Up>,
+ public Y<_Up>
+ { };
+ };
+ };
+}
+
OpenPOWER on IntegriCloud