Commit e5cc0d54 by Marek Polacek Committed by Marek Polacek

re PR c++/84925 (ICE with segfault in __PRETTY_FUNCTION__)

	PR c++/84925
	* pt.c (enclosing_instantiation_of): Check if fn is null.

	* g++.dg/cpp1z/lambda-__func__.C: New test.

From-SVN: r258660
parent 809c28c8
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.
......
......@@ -12917,7 +12917,7 @@ enclosing_instantiation_of (tree otctx)
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
......
// 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>;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment