re PR c++/57948 (internal compiler error: in initialize_reference, at cp/call.c:9285)
/cp 2013-07-29 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57948 * call.c (initialize_reference): Don't crash when reference_binding returns a conv with conv->kind == ck_ambig. /testsuite 2013-07-29 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57948 * g++.dg/conversion/ambig2.C: New. From-SVN: r201318
This commit is contained in:
parent
88e594b6de
commit
3ea1e3286b
4 changed files with 38 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
|||
2013-07-29 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/57948
|
||||
* call.c (initialize_reference): Don't crash when reference_binding
|
||||
returns a conv with conv->kind == ck_ambig.
|
||||
|
||||
2013-07-29 Jason Merrill <jason@redhat.com>
|
||||
|
||||
* mangle.c (write_name): Check for null context.
|
||||
|
|
|
@ -9282,10 +9282,14 @@ initialize_reference (tree type, tree expr,
|
|||
return error_mark_node;
|
||||
}
|
||||
|
||||
gcc_assert (conv->kind == ck_ref_bind);
|
||||
|
||||
/* Perform the conversion. */
|
||||
expr = convert_like (conv, expr, complain);
|
||||
if (conv->kind == ck_ref_bind)
|
||||
/* Perform the conversion. */
|
||||
expr = convert_like (conv, expr, complain);
|
||||
else if (conv->kind == ck_ambig)
|
||||
/* We gave an error in build_user_type_conversion_1. */
|
||||
expr = error_mark_node;
|
||||
else
|
||||
gcc_unreachable ();
|
||||
|
||||
/* Free all the conversions we allocated. */
|
||||
obstack_free (&conversion_obstack, p);
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2013-07-29 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/57948
|
||||
* g++.dg/conversion/ambig2.C: New.
|
||||
|
||||
2013-07-29 Maciej W. Rozycki <macro@codesourcery.com>
|
||||
|
||||
* gcc.target/mips/fabs-2008.c: New test case.
|
||||
|
@ -85,7 +90,7 @@
|
|||
* gcc.c-torture/execute/builtins/stpcpy-chk.x: Likewise.
|
||||
|
||||
* gcc.dg/pr27095.c: For Epiphany, add -mshort-calls.
|
||||
* gcc.dg/tree-ssa/loop-1.c: Likewise.
|
||||
* gcc.dg/tree-ssa/loop-1.c: Likewise.
|
||||
|
||||
* gcc.dg/torture/pr37868.c: Disable for epiphany.
|
||||
* gcc.dg/sibcall-6.c: Enable for epiphany.
|
||||
|
|
18
gcc/testsuite/g++.dg/conversion/ambig2.C
Normal file
18
gcc/testsuite/g++.dg/conversion/ambig2.C
Normal file
|
@ -0,0 +1,18 @@
|
|||
// PR c++/57948
|
||||
|
||||
struct Base { };
|
||||
struct Derived : Base
|
||||
{
|
||||
struct Derived2 : Base
|
||||
{
|
||||
struct ConvertibleToBothDerivedRef
|
||||
{
|
||||
operator Derived&();
|
||||
operator Derived2&();
|
||||
void bind_lvalue_to_conv_lvalue_ambig(ConvertibleToBothDerivedRef both)
|
||||
{
|
||||
Base &br1 = both; // { dg-error "ambiguous" }
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
Loading…
Add table
Reference in a new issue