Commit bcbdfa4c by Jason Merrill Committed by Jason Merrill

PR c++/79606 - ICE with this->base_member in NSDMI

	* class.c (build_base_path): Check processing_template_decl.

From-SVN: r245593
parent 736a933c
2017-02-19 Jason Merrill <jason@redhat.com> 2017-02-19 Jason Merrill <jason@redhat.com>
PR c++/79606 - ICE with this->base_member in NSDMI
* class.c (build_base_path): Check processing_template_decl.
PR c++/79607 - ICE with T{} initializer PR c++/79607 - ICE with T{} initializer
* decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR. * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
......
...@@ -375,6 +375,7 @@ build_base_path (enum tree_code code, ...@@ -375,6 +375,7 @@ build_base_path (enum tree_code code,
set up properly yet, and the value doesn't matter there either; we're set up properly yet, and the value doesn't matter there either; we're
just interested in the result of overload resolution. */ just interested in the result of overload resolution. */
if (cp_unevaluated_operand != 0 if (cp_unevaluated_operand != 0
|| processing_template_decl
|| in_template_function ()) || in_template_function ())
{ {
expr = build_nop (ptr_target_type, expr); expr = build_nop (ptr_target_type, expr);
......
// PR c++/79606
// { dg-do compile { target c++11 } }
struct A
{
int i = 0;
};
template<int> struct B : A
{
int j = this->i;
};
B<0> b;
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