Summary: | [4.0 regression] ICE creating pointer-to-reference-member | ||
---|---|---|---|
Product: | gcc | Reporter: | Volker Reichelt <reichelt> |
Component: | c++ | Assignee: | Mark Mitchell <mark> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | fang, gcc-bugs, nathan |
Priority: | P2 | Keywords: | ice-on-invalid-code, monitored |
Version: | 4.2.0 | ||
Target Milestone: | 4.1.2 | ||
Host: | Target: | ||
Build: | Known to work: | 4.1.2 4.2.0 4.3.0 | |
Known to fail: | 4.1.1 | Last reconfirmed: | 2006-08-14 19:04:06 |
Description
Volker Reichelt
2006-07-11 16:11:44 UTC
A regression hunt on powerpc-linux identified the following patch: http://gcc.gnu.org/viewcvs?view=rev&rev=93055 r93055 | nathan | 2005-01-07 17:09:15 +0000 (Fri, 07 Jan 2005) Confirmed by Janis. Subject: Bug 28346 Author: mmitchel Date: Sun Aug 20 23:53:10 2006 New Revision: 116276 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116276 Log: PR c++/28341 * tree.c (cast_valid_in_integral_constant_expression_p): New function. * cp-tree.h (tsubst_copy_and_build): Adjust prototype. * pt.c (tsubst_expr): Add integral_constant_expression_p parameter. (fold_non_dependent_expr): Adjust callers of tsubst_{expr,copy_and_build}. (tsubst_friend_function): Likewise. (tsubst_template_arg): Likewise. (tsubst_default_argument): Likewise. (tsubst_decl): Likewise. (tsubst): Likewise. (tsubst_omp_clasuses): Likewise. (regenerate_decl_fromp_template): Likewise. (instantiate_decl): Likewise. (tsubst_initializer_list): Likewise. (tsubst_enum): Likewise. (tsubst_expr): Use RECUR throughout. (tsubst_copy_and_build): Change definition of RECUR. Do not allow invalid casts in integral constant expressions. * parser.c (cp_parser_postfix_expression): Use cast_valid_in_integral_constant_expression_p. (cp_parser_cast_expression): Likewise. (cp_parser_functional_cast): Likewise. PR c++/28346 * pt.c (tsubst_qualified_id): Do not strip references from OFFSET_REFs. 2006-08-20 Mark Mitchell <mark@codesourcery.com> PR c++/28341 * g++.dg/template/ref3.C: New test. * g++.dg/template/nontype13.C: New test. PR c++/28346 * g++.dg/template/ptrmem17.C: New test. 2006-08-20 Mark Mitchell <mark@codesourcery.com> * objcp-lang.c (objcp_tsubst_copy_and_build): Adjust call to tsubst_copy_and_build. Added: trunk/gcc/testsuite/g++.dg/template/ptrmem17.C trunk/gcc/testsuite/g++.dg/template/ref3.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/parser.c trunk/gcc/cp/pt.c trunk/gcc/cp/tree.c trunk/gcc/objcp/ChangeLog trunk/gcc/objcp/objcp-lang.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/template/nontype13.C Fixed in 4.2.0. Fixed in 4.1.2. Subject: Bug 28346 Author: mmitchel Date: Mon Aug 21 00:41:50 2006 New Revision: 116283 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116283 Log: PR c++/28346 * pt.c (tsubst_qualified_id): Do not strip references from OFFSET_REFs. PR c++/28346 * g++.dg/template/ptrmem17.C: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/ptrmem17.C Modified: branches/gcc-4_1-branch/gcc/cp/ChangeLog branches/gcc-4_1-branch/gcc/cp/pt.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog Because of Jason's patch for PR 28346 the code is now wrongly accepted on the 4.0 branch. With a slightly different testcase I can still trigger the ICE, though: ========================================== bool b; template<int> struct A { int& i; A(); ~A() { b = (&A::i == &A::i); } }; A<0> a; ========================================== Fixed in GCC-4.1.2. |