summaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorppalka <ppalka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-07-01 01:07:35 +0000
committerppalka <ppalka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-07-01 01:07:35 +0000
commit4171562ac9828de791442664d5bb432683ece771 (patch)
treeceb0b7ee730b66f97ae75356921decf7c2eff6d1 /gcc/cp/pt.c
parenta18eed18f800d806b804b69aef2f6a783f21c795 (diff)
downloadgcc-4171562ac9828de791442664d5bb432683ece771.tar.gz
Fix PR c++/66686 (dependent template template substitution)
gcc/cp/ChangeLog: PR c++/66686 * pt.c (coerce_template_template_parm) [PARM_DECL]: Don't return 0 if tsubst returns a dependent type. gcc/testsuite/ChangeLog: PR c++/66686 * g++.dg/template/pr66686.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225220 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 6b73d49ce29..38d2e3a24e3 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6363,11 +6363,13 @@ coerce_template_template_parm (tree parm,
D<int, C> d;
i.e. the parameter list of TT depends on earlier parameters. */
- if (!uses_template_parms (TREE_TYPE (arg))
- && !same_type_p
- (tsubst (TREE_TYPE (parm), outer_args, complain, in_decl),
- TREE_TYPE (arg)))
- return 0;
+ if (!uses_template_parms (TREE_TYPE (arg)))
+ {
+ tree t = tsubst (TREE_TYPE (parm), outer_args, complain, in_decl);
+ if (!uses_template_parms (t)
+ && !same_type_p (t, TREE_TYPE (arg)))
+ return 0;
+ }
if (TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (arg))
&& !TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (parm)))