outermost CV qualifiers of EXPR. */
type = build_reference_type (type);
if (uses_parameter_packs (expr))
- /* Stick with 'auto' even if the type could be deduced. */;
+ /* Stick with 'auto' even if the type could be deduced. */
+ TEMPLATE_TYPE_PARAMETER_PACK (auto_node) = true;
else
type = do_auto_deduction (type, expr, auto_node);
}
parameter pack (14.6.3), or the type-specifier-seq of a type-id that
is a pack expansion, the invented template parameter is a template
parameter pack. */
- if (ppd->type_pack_expansion_p && is_auto (t)
+ if (flag_concepts_ts && ppd->type_pack_expansion_p && is_auto (t)
&& TEMPLATE_TYPE_LEVEL (t) != 0)
TEMPLATE_TYPE_PARAMETER_PACK (t) = true;
if (TEMPLATE_TYPE_PARAMETER_PACK (t))
// PR c++/103497
// { dg-do compile { target c++14 } }
-void foo(decltype(auto)... args); // { dg-error "cannot declare a parameter with .decltype.auto.." }
+void foo(decltype(auto)... args); // { dg-error "contains no parameter packs" }
int main() {
foo();
--- /dev/null
+// PR c++/115378
+// { dg-do compile { target c++20 } }
+
+struct tt {};
+
+template<class Slot, auto Tag = []{}>
+constexpr auto __counter = 1;
+
+template <class Child, int Counter>
+using _as_base = tt;
+
+template <class... Envs>
+struct env : _as_base<Envs, __counter<int>>... {};
+
+env<int> t;
// PR c++/95672
// { dg-do compile { target c++14 } }
-struct g_class : decltype (auto) ... { }; // { dg-error "invalid use of pack expansion" }
+struct g_class : decltype (auto) ... { }; // { dg-error "contains no parameter packs" }