* [Bug c++/50473] [C++0x] ICE in type_has_nontrivial_copy_init, at cp/tree.c:2574
2011-09-21 13:10 [Bug c++/50473] New: [C++0x] ICE in type_has_nontrivial_copy_init, at cp/tree.c:2574 y121516 at gmail dot com
@ 2011-09-22 17:13 ` paolo.carlini at oracle dot com
2011-10-17 10:55 ` paolo.carlini at oracle dot com
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-09-22 17:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50473
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011-09-22
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/50473] [C++0x] ICE in type_has_nontrivial_copy_init, at cp/tree.c:2574
2011-09-21 13:10 [Bug c++/50473] New: [C++0x] ICE in type_has_nontrivial_copy_init, at cp/tree.c:2574 y121516 at gmail dot com
2011-09-22 17:13 ` [Bug c++/50473] " paolo.carlini at oracle dot com
@ 2011-10-17 10:55 ` paolo.carlini at oracle dot com
2011-11-11 6:04 ` paolo.carlini at oracle dot com
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-10-17 10:55 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50473
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org,
| |paolo.carlini at oracle dot
| |com
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-10-17 10:53:44 UTC ---
Jason, the call chain here is set_up_extended_ref_temp -> get_target_expr ->
get_target_expr_sfinae -> build_target_expr_with_type ->
type_has_nontrivial_copy_init, which hits gcc_assert (COMPLETE_TYPE_P (t)).
Looks like tweaking, eg, build_target_expr_with_type, to check for the
offending situation and return error_mark_node avoids the ICE, but I don't know
at the moment if something deeper is actually going on...
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/50473] [C++0x] ICE in type_has_nontrivial_copy_init, at cp/tree.c:2574
2011-09-21 13:10 [Bug c++/50473] New: [C++0x] ICE in type_has_nontrivial_copy_init, at cp/tree.c:2574 y121516 at gmail dot com
2011-09-22 17:13 ` [Bug c++/50473] " paolo.carlini at oracle dot com
2011-10-17 10:55 ` paolo.carlini at oracle dot com
@ 2011-11-11 6:04 ` paolo.carlini at oracle dot com
2011-11-11 11:22 ` paolo.carlini at oracle dot com
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-11-11 6:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50473
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-11-11 01:38:40 UTC ---
Apparently r181278 doesn't ICE anymore:
50473.C:14:36: error: taking address of temporary [-fpermissive]
50473.C:14:36: error: ‘* & s<0u>()’ is not a constant expression
but the error message seems anyway pretty obscure and actually I don't see why
the test is invalid. Jason, can you help triaging this?
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/50473] [C++0x] ICE in type_has_nontrivial_copy_init, at cp/tree.c:2574
2011-09-21 13:10 [Bug c++/50473] New: [C++0x] ICE in type_has_nontrivial_copy_init, at cp/tree.c:2574 y121516 at gmail dot com
` (2 preceding siblings ...)
2011-11-11 6:04 ` paolo.carlini at oracle dot com
@ 2011-11-11 11:22 ` paolo.carlini at oracle dot com
2011-11-11 21:54 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-11-11 11:22 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50473
--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-11-11 10:13:16 UTC ---
The rvalue reference is essential. With this we still ICE:
constexpr int f() { return 1; }
template<class T>
struct test
{
static constexpr auto&& value = f();
};
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/50473] [C++0x] ICE in type_has_nontrivial_copy_init, at cp/tree.c:2574
2011-09-21 13:10 [Bug c++/50473] New: [C++0x] ICE in type_has_nontrivial_copy_init, at cp/tree.c:2574 y121516 at gmail dot com
` (3 preceding siblings ...)
2011-11-11 11:22 ` paolo.carlini at oracle dot com
@ 2011-11-11 21:54 ` jason at gcc dot gnu.org
2014-11-17 4:36 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2011-11-11 21:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50473
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-11-11 21:27:08 UTC ---
Yep, the problem seems to be that we built up trees in the template that we
don't then want to tsubst.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/50473] [C++0x] ICE in type_has_nontrivial_copy_init, at cp/tree.c:2574
2011-09-21 13:10 [Bug c++/50473] New: [C++0x] ICE in type_has_nontrivial_copy_init, at cp/tree.c:2574 y121516 at gmail dot com
` (4 preceding siblings ...)
2011-11-11 21:54 ` jason at gcc dot gnu.org
@ 2014-11-17 4:36 ` jason at gcc dot gnu.org
2014-11-17 20:18 ` jason at gcc dot gnu.org
2014-11-17 20:21 ` jason at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2014-11-17 4:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50473
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/50473] [C++0x] ICE in type_has_nontrivial_copy_init, at cp/tree.c:2574
2011-09-21 13:10 [Bug c++/50473] New: [C++0x] ICE in type_has_nontrivial_copy_init, at cp/tree.c:2574 y121516 at gmail dot com
` (5 preceding siblings ...)
2014-11-17 4:36 ` jason at gcc dot gnu.org
@ 2014-11-17 20:18 ` jason at gcc dot gnu.org
2014-11-17 20:21 ` jason at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2014-11-17 20:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50473
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Mon Nov 17 20:17:56 2014
New Revision: 217672
URL: https://gcc.gnu.org/viewcvs?rev=217672&root=gcc&view=rev
Log:
PR c++/50473
* decl.c (cp_finish_decl): Don't try to process a non-dependent
constant initializer for a reference.
* pt.c (value_dependent_expression_p): A reference is always
dependent.
* call.c (extend_ref_init_temps_1): Also clear TREE_SIDE_EFFECTS
on any NOP_EXPRs.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-ref5.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/cp/decl.c
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-ice12.C
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/50473] [C++0x] ICE in type_has_nontrivial_copy_init, at cp/tree.c:2574
2011-09-21 13:10 [Bug c++/50473] New: [C++0x] ICE in type_has_nontrivial_copy_init, at cp/tree.c:2574 y121516 at gmail dot com
` (6 preceding siblings ...)
2014-11-17 20:18 ` jason at gcc dot gnu.org
@ 2014-11-17 20:21 ` jason at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2014-11-17 20:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50473
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |5.0
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for GCC 5.
^ permalink raw reply [flat|nested] 9+ messages in thread