aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/pt.c5
-rw-r--r--gcc/testsuite/g++.dg/template/dependent-tmpl2.C10
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f488a5a..0f119a5 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -10856,6 +10856,7 @@ uses_outer_template_parms (tree decl)
for (int i = TREE_VEC_LENGTH (parms) - 1; i >= 0; --i)
{
tree parm = TREE_VALUE (TREE_VEC_ELT (parms, i));
+ tree defarg = TREE_PURPOSE (TREE_VEC_ELT (parms, i));
if (TREE_CODE (parm) == PARM_DECL
&& for_each_template_parm (TREE_TYPE (parm),
template_parm_outer_level,
@@ -10864,6 +10865,10 @@ uses_outer_template_parms (tree decl)
if (TREE_CODE (parm) == TEMPLATE_DECL
&& uses_outer_template_parms (parm))
return true;
+ if (defarg
+ && for_each_template_parm (defarg, template_parm_outer_level,
+ &depth, NULL, /*nondeduced*/true))
+ return true;
}
}
tree ci = get_constraints (decl);
diff --git a/gcc/testsuite/g++.dg/template/dependent-tmpl2.C b/gcc/testsuite/g++.dg/template/dependent-tmpl2.C
new file mode 100644
index 0000000..040ddb4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/dependent-tmpl2.C
@@ -0,0 +1,10 @@
+// PR c++/100078
+// { dg-do compile { target c++11 } }
+
+template <bool> struct enable_if;
+template <typename Data> struct HashMapBucket {
+ template <typename T = Data>
+ static typename enable_if<T ::value>::type selectStructure() {
+ selectStructure();
+ }
+};