From: Dodji Seketeli Date: Fri, 18 Jul 2008 20:40:42 +0000 (+0000) Subject: re PR c++/36407 (ICE with conversion and -fpermissive) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6b3a665caf8ddc83110639630d7feb021d58ed63;p=gcc.git re PR c++/36407 (ICE with conversion and -fpermissive) 2008-07-18 Dodji Seketeli PR c++/36407 * call.c (convert_like_real): Don't take the error code path when a rvalue or base conversion has the bad_p field set. From-SVN: r137966 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6daff1e9df5..2112b8fd8e6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-07-18 Dodji Seketeli + + PR c++/36407 + * call.c (convert_like_real): Don't take the error code path + when a rvalue or base conversion has the bad_p field set. + 2008-07-18 Kris Van Hees * rtti.c (emit_support_tinfos): Add char16_type_node and diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 368d95a677f..3c54001e3bd 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -4510,7 +4510,9 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, if (convs->bad_p && convs->kind != ck_user && convs->kind != ck_ambig - && convs->kind != ck_ref_bind) + && convs->kind != ck_ref_bind + && convs->kind != ck_rvalue + && convs->kind != ck_base) { conversion *t = convs; for (; t; t = convs->u.next) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 79793fd3999..38e498c5759 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-07-18 Dodji Seketeli + + PR c++/36407 + * g++.dg/conversion/op5.C: New testcase. + 2008-07-18 Kris Van Hees Tests for char16_t and char32_t support. diff --git a/gcc/testsuite/g++.dg/conversion/op5.C b/gcc/testsuite/g++.dg/conversion/op5.C new file mode 100644 index 00000000000..69ef996d5c2 --- /dev/null +++ b/gcc/testsuite/g++.dg/conversion/op5.C @@ -0,0 +1,20 @@ +// Contributed by Dodji Seketeli +// Origin: PR c++/36407 +// { dg-do compile } + +struct A +{ + A (const A&); +}; + +struct B +{ + operator A&(); +}; + +void +foo (const B& b) +{ + const A a = b; // { dg-error "conversion from 'const B' to non-scalar type 'const A' requested" } +} +