re PR c++/40780 (ICE in gimplify_conversion)
PR c++/40780 * gimplify.c (gimplify_conversion): Don't change non-conversions into VIEW_CONVERT_EXPR. * g++.dg/template/ptrmem19.C: New test. From-SVN: r149740
This commit is contained in:
parent
e59be1b119
commit
4f93480919
4 changed files with 32 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2009-07-17 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/40780
|
||||
* gimplify.c (gimplify_conversion): Don't change non-conversions into
|
||||
VIEW_CONVERT_EXPR.
|
||||
|
||||
2009-07-16 Sandra Loosemore <sandra@codesourcery.com>
|
||||
|
||||
* doc/extend.texi (Nested Functions): Replace broken link with
|
||||
|
|
|
@ -1827,9 +1827,9 @@ gimplify_conversion (tree *expr_p)
|
|||
|
||||
/* If we have a conversion to a non-register type force the
|
||||
use of a VIEW_CONVERT_EXPR instead. */
|
||||
if (!is_gimple_reg_type (TREE_TYPE (*expr_p)))
|
||||
if (CONVERT_EXPR_P (*expr_p) && !is_gimple_reg_type (TREE_TYPE (*expr_p)))
|
||||
*expr_p = fold_build1_loc (loc, VIEW_CONVERT_EXPR, TREE_TYPE (*expr_p),
|
||||
TREE_OPERAND (*expr_p, 0));
|
||||
TREE_OPERAND (*expr_p, 0));
|
||||
|
||||
return GS_OK;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2009-07-17 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/40780
|
||||
* g++.dg/template/ptrmem19.C: New test.
|
||||
|
||||
2009-07-17 Aldy Hernandez <aldyh@redhat.com>
|
||||
Manuel López-Ibáñez <manu@gcc.gnu.org>
|
||||
|
||||
|
|
19
gcc/testsuite/g++.dg/template/ptrmem19.C
Normal file
19
gcc/testsuite/g++.dg/template/ptrmem19.C
Normal file
|
@ -0,0 +1,19 @@
|
|||
// PR c++/40780
|
||||
// { dg-do compile }
|
||||
|
||||
template <class T1, typename T2, typename T3>
|
||||
struct A
|
||||
{
|
||||
typedef T2 (T1::*m) (T3);
|
||||
A (m) {}
|
||||
};
|
||||
struct B;
|
||||
struct C
|
||||
{
|
||||
void foo (B *);
|
||||
};
|
||||
typedef A <C, void, B *> D;
|
||||
typedef void (C::*E) (B *);
|
||||
struct F;
|
||||
typedef void (C::*G) (F);
|
||||
D d ((E) (G) & C::foo);
|
Loading…
Add table
Reference in a new issue