On Thu, Jan 18, 2018 at 6:35 PM, Jakub Jelinek <ja...@redhat.com> wrote: > Hi! > > As mentioned in the PR, we ICE on this testcase because > w->fn is a conversion operator, w->convs[0]->type is a reference > to a class type, but because that conversion is ck_ref_bind, > source_type looks through it and finds ck_identity with > the class type. Then we because w->fn is not a constructor > do source = TREE_TYPE (source);, assuming we got a pointer > type like on the other 5 testcases in check-c++-all with -Wconversion > that cover this code, so source is NULL and we die in calling > warning with bogus arguments. > > The following patch fixes it by only using TREE_TYPE on pointer/reference > types. I must say I don't understand this fully, but conversion > operators should be used on class types, so that is what we are looking for > with source, right? No idea about the ! DECL_CONSTRUCTOR_P (w->fn) > check though and nothing in the testsuite covers that.
I think that the test for POINTER_TYPE_P can replace the DECL_CONSTRUCTOR_P test. Jason