summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/class-template-decl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-11-07 17:43:18 +0000
committerDouglas Gregor <dgregor@apple.com>2011-11-07 17:43:18 +0000
commit4109afa1f170a90ae70dd6534d3b474c74956709 (patch)
tree59bd8b41118c5a6d3d11a00cedc9e9a5df0211f6 /clang/test/SemaTemplate/class-template-decl.cpp
parentdf593fbedaafde7e4a42785ba50c969587b6e290 (diff)
downloadbcm5719-llvm-4109afa1f170a90ae70dd6534d3b474c74956709.tar.gz
bcm5719-llvm-4109afa1f170a90ae70dd6534d3b474c74956709.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>. Reinstated, now that we have the fix in r143967. llvm-svn: 143968
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