This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/85148] [6/7/8 Regression] ICE with NSDMI and this pointer
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Apr 2018 07:07:49 +0000
- Subject: [Bug c++/85148] [6/7/8 Regression] ICE with NSDMI and this pointer
- Auto-submitted: auto-generated
- References: <bug-85148-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85148
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-04-03
CC| |jakub at gcc dot gnu.org,
| |jason at gcc dot gnu.org
Target Milestone|--- |6.5
Ever confirmed|0 |1
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I get ICE already with r185596 when -std=c++1y option has been introduced:
pr85148.C:1:29: internal compiler error: tree check: expected tree that
contains ‘common’ structure, have ‘constructor’ in perform_member_init, at
cp/init.c:661
Then starting with r210653 it is rejected:
pr85148.C: In function ‘void foo()’:
pr85148.C:8:28: error: could not convert ‘(long int)this’ from ‘long int’ to
‘A<long int>’
A<A<__PTRDIFF_TYPE__>> a{};
^
pr85148.C: In constructor ‘constexpr A<A<long int> >::A()’:
pr85148.C:1:29: error: could not convert ‘(long int)this’ from ‘long int’ to
‘A<long int>’
template<typename T> struct A
^
pr85148.C: In function ‘void foo()’:
pr85148.C:8:28: note: synthesized method ‘constexpr A<A<long int> >::A()’ first
required here
A<A<__PTRDIFF_TYPE__>> a{};
^
Then starting with r216750 it ICEs in tsubst_copy:
pr85148.C: In function ‘void foo()’:
pr85148.C:8:28: internal compiler error: in tsubst_copy, at cp/pt.c:12755
A<A<__PTRDIFF_TYPE__>> a{};
^
0x71171b tsubst_copy
../../gcc/cp/pt.c:12755
0x720a9b tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/cp/pt.c:15464
and finally starting with r234442 in replace_placeholders.
It hasn't been fixed by the r258593 changes, seems the PLACEHOLDER_EXPR refers
to the outer A when it should be refering to the inner A? Or I'm totally
confused on what exactly it should do.