* pt.c (tsubst_pack_expansion): Fix handling of non-packs in
local_specializations.
From-SVN: r257699
+2018-02-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/84368 - wrong error with local variable in variadic lambda.
+ * pt.c (tsubst_pack_expansion): Fix handling of non-packs in
+ local_specializations.
+
2018-02-15 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84330
context. */
tree gen = TREE_PURPOSE (elt);
tree inst = TREE_VALUE (elt);
- if (DECL_PACK_P (inst))
- inst = retrieve_local_specialization (inst);
+ if (DECL_P (inst))
+ if (tree local = retrieve_local_specialization (inst))
+ inst = local;
/* else inst is already a full instantiation of the pack. */
register_local_specialization (inst, gen);
}
--- /dev/null
+// PR c++/84368
+// { dg-do compile { target c++14 } }
+
+template < typename ... T >
+void sink(T ...){}
+
+template < typename ... T >
+void foo(T ... v){
+ [](auto ... v){
+ auto bar = [](auto, auto){ return 0; };
+ sink(bar(v, T{}) ...);
+ }(v ...);
+}
+
+int main(){
+ foo(0);
+}