Skip to content

Commit

Permalink
PR c++/79606 - ICE with this->base_member in NSDMI
Browse files Browse the repository at this point in the history
	* class.c (build_base_path): Check processing_template_decl.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245593 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
jason committed Feb 20, 2017
1 parent 9722fa4 commit 8de8559
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gcc/cp/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
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
* decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.

Expand Down
1 change: 1 addition & 0 deletions gcc/cp/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
just interested in the result of overload resolution. */
if (cp_unevaluated_operand != 0
|| processing_template_decl
|| in_template_function ())
{
expr = build_nop (ptr_target_type, expr);
Expand Down
14 changes: 14 additions & 0 deletions gcc/testsuite/g++.dg/cpp0x/nsdmi-template16.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// 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;

0 comments on commit 8de8559

Please sign in to comment.