2015-11-19 Ryan Burn <contact@rnburn.com>
* pt.c (find_parameter_packs_r) [DECLTYPE_TYPE]: When traversing
the DECLTYPE_TYPE_EXPR, set type_pack_expansion_p to false.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230620
138bc75d-0d04-0410-961f-
82ee72b054a4
+2015-11-19 Ryan Burn <contact@rnburn.com>
+
+ PR c++/68396
+ * pt.c (find_parameter_packs_r) [DECLTYPE_TYPE]: When traversing
+ the DECLTYPE_TYPE_EXPR, set type_pack_expansion_p to false.
+
2015-11-19 Cesar Philippidis <cesar@codesourcery.com>
* parser.h (struct cp_omp_declare_simd_data): Add clauses member.
*walk_subtrees = 0;
return NULL_TREE;
+ case DECLTYPE_TYPE:
+ {
+ /* When traversing a DECLTYPE_TYPE_EXPR, we need to set
+ type_pack_expansion_p to false so that any placeholders
+ within the expression don't get marked as parameter packs. */
+ bool type_pack_expansion_p = ppd->type_pack_expansion_p;
+ ppd->type_pack_expansion_p = false;
+ cp_walk_tree (&DECLTYPE_TYPE_EXPR (t), &find_parameter_packs_r,
+ ppd, ppd->visited);
+ ppd->type_pack_expansion_p = type_pack_expansion_p;
+ *walk_subtrees = 0;
+ return NULL_TREE;
+ }
+
default:
return NULL_TREE;
}
--- /dev/null
+// { dg-do compile { target c++14 } }
+
+template <unsigned>
+auto f () {
+ return 2;
+}
+
+template <class>
+class A {};
+
+template <int... Ix>
+auto g () {
+ A<decltype(f<Ix> ())...>();
+ return f<2> ();
+}