https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88857
--- Comment #8 from Marek Polacek ---
Author: mpolacek
Date: Thu Feb 28 00:07:06 2019
New Revision: 269267
URL: https://gcc.gnu.org/viewcvs?rev=269267=gcc=rev
Log:
PR c++/88857 - ICE with value-initialization of argument in template.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88857
Marek Polacek changed:
What|Removed |Added
Status|NEW |ASSIGNED
Assignee|unassigned
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88857
--- Comment #7 from Will Benfold ---
I think it's not so much class vs struct: I get an ICE iff 'a' is private.
Just changing class -> struct stops the ICE, but then it comes back again if
you make 'a' private.
Similarly, with a class you can
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88857
--- Comment #6 from Marek Polacek ---
(In reply to Jakub Jelinek from comment #5)
> Indeed:
> class S { int a; };
> void foo (const S &, int);
>
> template
> void
> bar ()
> {
> foo ({});
> }
>
> With s/class/struct/ it doesn't ICE.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88857
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #5
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88857
--- Comment #4 from Marek Polacek ---
With the modified testcase the ICE started with r173679:
$ ./cc1plus.173678 -quiet ~/k.C -std=c++0x
k.C: In function ‘void g()’:
k.C:11:7: error: invalid initialization of reference of type ‘const Foo&’
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88857
--- Comment #3 from Will Benfold ---
(In reply to Marek Polacek from comment #2)
> Started with r202612.
Is that just because before r202612, there was no support for 'auto' in a
function declaration?
I see the ICE with every release down to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88857
Richard Biener changed:
What|Removed |Added
Priority|P3 |P2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88857
Marek Polacek changed:
What|Removed |Added
Target Milestone|--- |7.5
Summary|ICE in