[Bug c++/58583] [c++11] ICE with invalid non-static data member initialization in template

2016-01-05 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58583

--- Comment #9 from Nathan Sidwell  ---
Author: nathan
Date: Tue Jan  5 14:40:11 2016
New Revision: 232075

URL: https://gcc.gnu.org/viewcvs?rev=232075=gcc=rev
Log:
gcc/cp/
PR c++/58583
* pt.c (build_non_dependent_expr): Don't try a checking fold when
parsing an nsdmi.

gcc/testsuite/
PR c++/58583
* g++.dg/cpp0x/nsdmi-template14.C: Adjust test & errors.

Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C

[Bug c++/58583] [c++11] ICE with invalid non-static data member initialization in template

2016-01-05 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58583

Nathan Sidwell  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #10 from Nathan Sidwell  ---
Patch tested with both checking & release builds.  Applied.

[Bug c++/58583] [c++11] ICE with invalid non-static data member initialization in template

2015-12-30 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58583

John David Anglin  changed:

   What|Removed |Added

 CC||danglin at gcc dot gnu.org

--- Comment #8 from John David Anglin  ---
*** Bug 67081 has been marked as a duplicate of this bug. ***

[Bug c++/58583] [c++11] ICE with invalid non-static data member initialization in template

2015-10-05 Thread miyuki at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58583

Mikhail Maltsev  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||miyuki at gcc dot gnu.org
 Resolution|FIXED   |---

--- Comment #7 from Mikhail Maltsev  ---
The diagnostic differs between "--enable-checking=yes" and
"--enable-checking=release" builds:

Checking:
miyuki@gcc-build1:~$ /opt/gcc-6-latest/bin/g++ -std=c++11 ./nsdmi-template14.C
./nsdmi-template14.C:6:20: error: constructor required before non-static data
member for 'A<0>::i' has been parsed
   int i = (A<0>(), 0); // { dg-error "has been parsed" }
^
./nsdmi-template14.C: In constructor 'constexpr A<0>::A()':
./nsdmi-template14.C:4:22: error: constructor required before non-static data
member for 'A<0>::i' has been parsed
 template struct A // { dg-error "has been parsed" }
  ^
./nsdmi-template14.C: At global scope:
./nsdmi-template14.C:6:20: note: synthesized method 'constexpr A<0>::A()' first
required here 
   int i = (A<0>(), 0); // { dg-error "has been parsed" }
^
./nsdmi-template14.C:14:6: error: recursive instantiation of non-static data
member initializer for 'B<1>::p'
 B<1> x; // { dg-error "recursive instantiation of non-static data" }
  ^

Release:
miyuki@gcc-build1:~$ /opt/gcc-6-latest-rel/bin/g++ -std=c++11
./nsdmi-template14.C
./nsdmi-template14.C:14:6: error: recursive instantiation of non-static data
member initializer for 'B<1>::p'
 B<1> x; // { dg-error "recursive instantiation of non-static data" }
  ^

The latter obviously does not pass the test.


[Bug c++/58583] [c++11] ICE with invalid non-static data member initialization in template

2015-08-03 Thread gnugcc at marino dot st
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58583

John Marino gnugcc at marino dot st changed:

   What|Removed |Added

 CC||gnugcc at marino dot st

--- Comment #6 from John Marino gnugcc at marino dot st ---
so apparently this patch caused a lot of failures:
https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01062.html

However, I don't see people complaining anymore, nor do I see it on other
testsuite result posts.

However, we're still seeing this on DragonFly:
https://gcc.gnu.org/ml/gcc-testresults/2015-08/msg00196.html

What was the final conclusion?
Is it a dejagnu problem or what?


[Bug c++/58583] [c++11] ICE with invalid non-static data member initialization in template

2015-06-15 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58583

Nathan Sidwell nathan at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Nathan Sidwell nathan at gcc dot gnu.org ---
fixed on trunk.  Note initializers are instantiated lazily, so invalid ones may
be accepted without error, if never instantiated.


[Bug c++/58583] [c++11] ICE with invalid non-static data member initialization in template

2015-06-15 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58583

--- Comment #4 from Nathan Sidwell nathan at gcc dot gnu.org ---
Author: nathan
Date: Tue Jun 16 01:59:55 2015
New Revision: 224502

URL: https://gcc.gnu.org/viewcvs?rev=224502root=gccview=rev
Log:
cp/
PR c++/58583
* cp-tree.h (DECL_INSTANTIATING_NSDMI_P): New.
* init.c (get_nsdmi): Check for DEFAULT_ARG in template case and
protect it from recursive instantiation.

testsuite/
PR c++/58583
* g++.dg/cpp0x/nsdmi-template14.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-template14.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/init.c
trunk/gcc/testsuite/ChangeLog


[Bug c++/58583] [c++11] ICE with invalid non-static data member initialization in template

2015-05-27 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58583

Nathan Sidwell nathan at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||nathan at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |nathan at gcc dot 
gnu.org


[Bug c++/58583] [c++11] ICE with invalid non-static data member initialization in template

2014-08-13 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58583

--- Comment #3 from Volker Reichelt reichelt at gcc dot gnu.org ---
Since May all three testcases ICE on trunk.


[Bug c++/58583] [c++11] ICE with invalid non-static data member initialization in template

2013-12-30 Thread reichelt at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58583

--- Comment #2 from Volker Reichelt reichelt at gcc dot gnu.org ---
The second testcase is now also wrongly accepted, due to the fix for PR57887.
However, the following testcase still crashes with almost the same stacktrace:

===
templateint struct A
{
  int i = (A0(), 0);
};
===

bug.cc: In constructor 'constexpr A0::A()':
bug.cc:1:22: internal compiler error: in tsubst_copy, at cp/pt.c:12863
 templateint struct A
  ^
0x5f62a3 tsubst_copy
../../gcc/gcc/cp/pt.c:12863
0x5d35f2 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/gcc/cp/pt.c:15083
0x6d8523 perform_member_init
../../gcc/gcc/cp/init.c:537
0x6d8523 emit_mem_initializers(tree_node*)
../../gcc/gcc/cp/init.c:1096
0x6e310e synthesize_method(tree_node*)
../../gcc/gcc/cp/method.c:799
0x6532f4 mark_used(tree_node*, int)
../../gcc/gcc/cp/decl2.c:4779
0x580359 build_over_call
../../gcc/gcc/cp/call.c:7119
0x57bd35 build_new_method_call_1
../../gcc/gcc/cp/call.c:7818
0x57bd35 build_new_method_call(tree_node*, tree_node*, vectree_node*, va_gc,
vl_embed**, tree_node*, int, tree_node**, int)
../../gcc/gcc/cp/call.c:7888
0x57ce17 build_special_member_call(tree_node*, tree_node*, vectree_node*,
va_gc, vl_embed**, tree_node*, int, int)
../../gcc/gcc/cp/call.c:7444
0x6d5697 build_value_init(tree_node*, int)
../../gcc/gcc/cp/init.c:345
0x61ee49 build_functional_cast(tree_node*, tree_node*, int)
../../gcc/gcc/cp/typeck2.c:1858
0x5d364e tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/gcc/cp/pt.c:14053
0x5d77a5 fold_non_dependent_expr_sfinae(tree_node*, int)
../../gcc/gcc/cp/pt.c:5111
0x5d77e9 build_non_dependent_expr(tree_node*)
../../gcc/gcc/cp/pt.c:21234
0x6a93e7 build_x_compound_expr(unsigned int, tree_node*, tree_node*, int)
../../gcc/gcc/cp/typeck.c:6136
0x6847fb cp_parser_expression
../../gcc/gcc/cp/parser.c:8294
0x67bb3f cp_parser_primary_expression
../../gcc/gcc/cp/parser.c:4279
0x67e5da cp_parser_postfix_expression
../../gcc/gcc/cp/parser.c:5969
0x681698 cp_parser_unary_expression
../../gcc/gcc/cp/parser.c:7170
Please submit a full bug report, [etc.]


[Bug c++/58583] [c++11] ICE with invalid non-static data member initialization in template

2013-10-04 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58583

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2013-10-04
 Blocks||58616
 Ever confirmed|0   |1


[Bug c++/58583] [c++11] ICE with invalid non-static data member initialization in template

2013-10-01 Thread mpolacek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58583

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org,
   ||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek mpolacek at gcc dot gnu.org ---
The ICE started with r180707.