This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/29704] [4.1 Regression] ICE: default non-type template argument of pointer-to-member type
- From: "brolley at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jun 2007 15:48:09 -0000
- Subject: [Bug c++/29704] [4.1 Regression] ICE: default non-type template argument of pointer-to-member type
- References: <bug-29704-1824@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from brolley at redhat dot com 2007-06-07 15:48 -------
As Andrew Pinski has noted, 4.2.0 rejects the code with a proper error message.
The latest trunk does the same. The change which fixes this is
2006-08-20 Mark Mitchell <mark@codesourcery.com>
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.
I'm attaching a patch for gcc-4_1_branch which brings in this change.
--
brolley at redhat dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |brolley at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29704