Summary: | [4.1 regression] ICE with C99 style compound literal vs templates vs instantiation | ||
---|---|---|---|
Product: | gcc | Reporter: | Volker Reichelt <reichelt> |
Component: | c++ | Assignee: | Mark Mitchell <mark> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | fang, gcc-bugs |
Priority: | P1 | Keywords: | ice-on-valid-code, monitored |
Version: | 4.3.0 | ||
Target Milestone: | 4.2.0 | ||
Host: | Target: | ||
Build: | Known to work: | 4.2.0 4.3.0 | |
Known to fail: | 4.1.3 | Last reconfirmed: | 2007-03-04 22:00:04 |
Bug Depends on: | 28255 | ||
Bug Blocks: |
Description
Volker Reichelt
2007-03-04 21:27:32 UTC
I can fix the testcase here by optimizing when we produce a CLEANUP_POINT_EXPR but the following testcase still fails at that point: int f(void); template<int> void foo() { int i = (int) { f() }; } template void foo<0>(); #8 0x0017dc54 in cp_parser_initializer_clause (parser=0x434e1dc0, non_constant_p=0xbffff039 "") at ../../gcc/cp/parser.c:12954 12954 initializer = fold_non_dependent_expr (initializer); And fold_non_dependent_expr sets processing_template_decl to false. Subject: Bug 31038 Author: mmitchel Date: Mon Mar 12 00:26:39 2007 New Revision: 122829 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122829 Log: PR c++/30328 * semantics.c (finish_typeof): Use unlowered_expr_type. PR c++/30328 * g++.dg/ext/bitfield1.C: New test. PR c++/31038 * parser.c (cp_parser_postfix_expression): Disallow compound literals in constant expressions. PR c++/31038 * g++.dg/template/complit2.C: New test. Added: trunk/gcc/testsuite/g++.dg/ext/bitfield1.C trunk/gcc/testsuite/g++.dg/template/complit2.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/cp/semantics.c trunk/gcc/testsuite/ChangeLog Fixed in 4.3.0. Subject: Bug 31038 Author: mmitchel Date: Mon Mar 12 01:52:45 2007 New Revision: 122830 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122830 Log: PR c++/31038 * parser.c (cp_parser_postfix_expression): Disallow compound literals in constant expressions. PR c++/30328 * semantics.c (finish_typeof): Use unlowered_expr_type. PR c++/31038 * g++.dg/template/complit2.C: New test. PR c++/30328 * g++.dg/ext/bitfield1.C: New test. Added: branches/gcc-4_2-branch/gcc/testsuite/g++.dg/ext/bitfield1.C branches/gcc-4_2-branch/gcc/testsuite/g++.dg/template/complit2.C Modified: branches/gcc-4_2-branch/gcc/cp/ChangeLog branches/gcc-4_2-branch/gcc/cp/parser.c branches/gcc-4_2-branch/gcc/cp/semantics.c branches/gcc-4_2-branch/gcc/testsuite/ChangeLog What caused this regression was the change of representation of CONSTRUCTOR. I can make this easy work with a simple patch which looks at values of the CONSTRUCTOR. Closing 4.1 branch. |