PR c++/84925
* pt.c (enclosing_instantiation_of): Check if fn is null.
* g++.dg/cpp1z/lambda-__func__.C: New test.
From-SVN: r258660
+2018-03-19 Marek Polacek <polacek@redhat.com>
+
+ PR c++/84925
+ * pt.c (enclosing_instantiation_of): Check if fn is null.
+
2018-03-16 Jason Merrill <jason@redhat.com>
PR c++/71834 - template-id with too few arguments.
for (; flambda_count < lambda_count && fn && LAMBDA_FUNCTION_P (fn);
fn = decl_function_context (fn))
++flambda_count;
- if (DECL_TEMPLATE_INFO (fn)
+ if ((fn && DECL_TEMPLATE_INFO (fn))
? most_general_template (fn) != most_general_template (tctx)
: fn != tctx)
continue;
+2018-03-19 Marek Polacek <polacek@redhat.com>
+
+ PR c++/84925
+ * g++.dg/cpp1z/lambda-__func__.C: New test.
+
2018-03-19 Maxim Ostapenko <m.ostapenko@samsung.com>
PR sanitizer/78651
--- /dev/null
+// PR c++/84925
+// { dg-options "-std=c++17" }
+
+template <typename>
+struct A {
+ static const int value = 0;
+ static auto constexpr fn = [] { return __func__; };
+};
+
+template <typename type>
+int x = A<type>::value;
+
+auto s = x<int>;