mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-08 15:42:07 +08:00
re PR c++/38725 (ICE with goto)
PR c++/38725 * semantics.c (finish_goto_stmt): Convert destination to void *. * g++.dg/ext/label11.C: New test. From-SVN: r143177
This commit is contained in:
parent
78415d7d4c
commit
f5651df1ab
@ -1,3 +1,9 @@
|
||||
2009-01-07 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/38725
|
||||
* semantics.c (finish_goto_stmt): Convert destination to
|
||||
void *.
|
||||
|
||||
2009-01-06 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/35297
|
||||
|
@ -547,7 +547,12 @@ finish_goto_stmt (tree destination)
|
||||
{
|
||||
/* The DESTINATION is being used as an rvalue. */
|
||||
if (!processing_template_decl)
|
||||
destination = decay_conversion (destination);
|
||||
{
|
||||
destination = decay_conversion (destination);
|
||||
destination = cp_convert (ptr_type_node, destination);
|
||||
if (error_operand_p (destination))
|
||||
return NULL_TREE;
|
||||
}
|
||||
/* We don't inline calls to functions with computed gotos.
|
||||
Those functions are typically up to some funny business,
|
||||
and may be depending on the labels being at particular
|
||||
|
@ -1,3 +1,8 @@
|
||||
2009-01-07 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/38725
|
||||
* g++.dg/ext/label11.C: New test.
|
||||
|
||||
2009-01-07 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
* lib/target-supports.exp (check_weak_override_available): New.
|
||||
|
46
gcc/testsuite/g++.dg/ext/label11.C
Normal file
46
gcc/testsuite/g++.dg/ext/label11.C
Normal file
@ -0,0 +1,46 @@
|
||||
// PR c++/38725
|
||||
// { dg-do compile }
|
||||
// { dg-options "" }
|
||||
|
||||
struct A {};
|
||||
struct B : virtual A {};
|
||||
int vi;
|
||||
void *vp;
|
||||
|
||||
void
|
||||
f1 (int i)
|
||||
{
|
||||
goto *i;
|
||||
}
|
||||
|
||||
void
|
||||
f2 (B b)
|
||||
{
|
||||
goto *b; // { dg-error "cannot convert" }
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
f3 (T i)
|
||||
{
|
||||
goto *i;
|
||||
}
|
||||
|
||||
void
|
||||
f3a ()
|
||||
{
|
||||
f3 (vi);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
f4 (T i)
|
||||
{
|
||||
goto *i;
|
||||
}
|
||||
|
||||
void
|
||||
f4a ()
|
||||
{
|
||||
f4 (vp);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user