diff options
author | Mark Mitchell <mark@codesourcery.com> | 2005-09-12 22:38:34 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2005-09-12 22:38:34 +0000 |
commit | 6f25cb3578f72310c50d4ea2d89179e169beec31 (patch) | |
tree | ef9919c9c5b79ac00d1c64401535d51148119164 /gcc/cp/cvt.c | |
parent | b35c082263257779ba2c3e2ae8fbeaa19bfdf374 (diff) | |
download | gcc-6f25cb3578f72310c50d4ea2d89179e169beec31.zip gcc-6f25cb3578f72310c50d4ea2d89179e169beec31.tar.gz gcc-6f25cb3578f72310c50d4ea2d89179e169beec31.tar.bz2 |
re PR c++/23789 (compilation error when template parameters have certain complexity)
PR c++/23789
* cvt.c (perform_qualification_conversions): Don't create
unnecessary NOP_EXPRs.
* pt.c (tsubst_template_arg): Use fold_non_dependent_expr.
PR c++/23789
* g++.dg/template/nontype14.C: New test.
From-SVN: r104193
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index de0792a..ac24e0a 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -1209,8 +1209,10 @@ perform_qualification_conversions (tree type, tree expr) expr_type = TREE_TYPE (expr); - if (TYPE_PTR_P (type) && TYPE_PTR_P (expr_type) - && comp_ptr_ttypes (TREE_TYPE (type), TREE_TYPE (expr_type))) + if (same_type_p (type, expr_type)) + return expr; + else if (TYPE_PTR_P (type) && TYPE_PTR_P (expr_type) + && comp_ptr_ttypes (TREE_TYPE (type), TREE_TYPE (expr_type))) return build_nop (type, expr); else if (TYPE_PTR_TO_MEMBER_P (type) && TYPE_PTR_TO_MEMBER_P (expr_type) |