]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/cp/pt.c
re PR c++/28341 (ICE with references as template parameters)
authorMark Mitchell <mark@codesourcery.com>
Sun, 20 Aug 2006 23:53:10 +0000 (23:53 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 20 Aug 2006 23:53:10 +0000 (23:53 +0000)
commit015c2c66b2dd446ba94955f0794ca06ce3b0d267
tree4756c8f497c36fa34840353e1ec97dc8da3e2992
parent1057fc810fbf25761a2a9d14bad091c963020c62
re PR c++/28341 (ICE with references as template parameters)

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.

From-SVN: r116276
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/tree.c
gcc/objcp/ChangeLog
gcc/objcp/objcp-lang.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/nontype13.C
gcc/testsuite/g++.dg/template/ptrmem17.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/ref3.C [new file with mode: 0644]