summaryrefslogtreecommitdiff
path: root/test/SemaTemplate
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-02-21 06:30:38 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-02-21 06:30:38 +0000
commit735b586081cd2e830b82fe1edd19a173e3512a60 (patch)
tree08101d45975c90d58f3333905c256aa32fc0803f /test/SemaTemplate
parentd4c85a8040ce7d08cab2fce51d3516a6c4bc973d (diff)
PR32010: Fix template argument depth mixup when forming implicit constructor
template deduction guides for class template argument deduction. Ensure that we have a local instantiation scope for tracking the instantiated parameters. Additionally, unusually, we're substituting at depth 1 and leaving depth 0 alone; make sure that we don't reduce template parameter depth by 2 for inner parameters in the process. (This is probably also broken for alias templates in the case where they're expanded within a dependent context, but this patch doesn't fix that.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295696 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r--test/SemaTemplate/deduction.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaTemplate/deduction.cpp b/test/SemaTemplate/deduction.cpp
index 16e01a9346..a1180f0988 100644
--- a/test/SemaTemplate/deduction.cpp
+++ b/test/SemaTemplate/deduction.cpp
@@ -481,3 +481,16 @@ namespace check_extended_pack {
int n;
void h() { g<0>(Y<0, &n>()); } // expected-error {{no matching function}}
}
+
+namespace dependent_template_template_param_non_type_param_type {
+ template<int N> struct A { // expected-note 2{{candidate}}
+ template<typename V = int, V M = 12, V (*Y)[M], template<V (*v)[M]> class W>
+ A(W<Y>); // expected-note {{[with V = int, M = 12, Y = &dependent_template_template_param_non_type_param_type::n]}}
+ };
+
+ int n[12];
+ template<int (*)[12]> struct Q {};
+ Q<&n> qn;
+ // FIXME: This should be accepted, but we somehow fail to deduce W.
+ A<0> a(qn); // expected-error {{no matching constructor for initialization}}
+}