summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-template-template-parm.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2010-12-10 17:08:53 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2010-12-10 17:08:53 +0000
commit0168763e7d90bad49714fd9db1f1b01326f20caf (patch)
tree6cf79605650d08672709622e02a228e1e9db1bb1 /clang/test/SemaTemplate/instantiate-template-template-parm.cpp
parent352d5e5362caf625fe3830d9eb00efb6582dbda3 (diff)
downloadbcm5719-llvm-0168763e7d90bad49714fd9db1f1b01326f20caf.tar.gz
bcm5719-llvm-0168763e7d90bad49714fd9db1f1b01326f20caf.zip
Do not substitute template types if template has dependent context
We should not substitute template types if the template has a dependent context because the template argument stack is not yet fully formed. Instead, defer substitution until the template has a non-dependent context (i.e. instantiation of an outer template). llvm-svn: 121491
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-template-template-parm.cpp')
-rw-r--r--clang/test/SemaTemplate/instantiate-template-template-parm.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-template-template-parm.cpp b/clang/test/SemaTemplate/instantiate-template-template-parm.cpp
index f48a0c7a714..1e3346998fa 100644
--- a/clang/test/SemaTemplate/instantiate-template-template-parm.cpp
+++ b/clang/test/SemaTemplate/instantiate-template-template-parm.cpp
@@ -44,3 +44,18 @@ template<long V> struct X3l { }; // expected-note{{different type 'long'}}
X2<int, X3i> x2okay;
X2<long, X3l> x2bad; // expected-note{{instantiation}}
+
+template <typename T, template <T, T> class TT, class R = TT<1, 2> >
+struct Comp {
+ typedef R r1;
+ template <T x, T y> struct gt {
+ static const bool result = x > y;
+ };
+ typedef gt<2, 1> r2;
+};
+
+template <int x, int y> struct lt {
+ static const bool result = x < y;
+};
+
+Comp<int, lt> c0;
OpenPOWER on IntegriCloud