This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH for c++/56238 (ice-checking with static_cast)
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 16 Mar 2013 14:46:59 -0400
- Subject: Re: C++ PATCH for c++/56238 (ice-checking with static_cast)
- References: <5116B35D.8050500@redhat.com>
On 02/09/2013 03:36 PM, Jason Merrill wrote:
The code in build_non_dependent_expr has caught a number of issues in
the compiler; this is another case that fold_non_dependent_expr wasn't
properly recognizing as dependent. I think we want to use
instantiation_dependent there going forward, but for 4.8 I think let's
just check it in the ENABLE_CHECKING code.
Now that we're in stage 1 again, let's make that change.
Tested x86_64-pc-linux-gnu, applying to trunk.
commit d76feeb24741fabc5ebbf1d46b8eaf8ac8006b10
Author: Jason Merrill <jason@redhat.com>
Date: Thu Feb 7 12:49:05 2013 -0500
PR c++/56238
* pt.c (fold_non_dependent_expr_sfinae): Check
instantiation_dependent_expression_p.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 36175ca..6264add 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5044,9 +5044,8 @@ fold_non_dependent_expr_sfinae (tree expr, tsubst_flags_t complain)
as two declarations of the same function, for example. */
if (processing_template_decl
- && !type_dependent_expression_p (expr)
- && potential_constant_expression (expr)
- && !value_dependent_expression_p (expr))
+ && !instantiation_dependent_expression_p (expr)
+ && potential_constant_expression (expr))
{
HOST_WIDE_INT saved_processing_template_decl;