On Tue, Feb 5, 2019 at 1:37 AM Alexandre Oliva <aol...@redhat.com> wrote: > On Jan 31, 2019, Jason Merrill <ja...@redhat.com> wrote: > > > Let's use strip_using_decl instead > > Aah, nice! Thanks, I'll make the changes, test them, and post a new patch. > > > >> @@ -13288,7 +13295,8 @@ grok_special_member_properties (tree decl) > >> { > >> tree class_type; > >> - if (!DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)) > >> + if (TREE_CODE (decl) != USING_DECL > >> + && !DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)) > >> return; > > > Is there a reason not to use it here, as well? > > The using decl will take us to a member of a different class, and this > function takes the DECL_CONTEXT of decl and adjusts the properties of > that class. If we followed USING_DECLs in decl that early, we'd adjust > (again?) the member properties of USING_DECL_SCOPE(original using decl), > rather than of DECL_CONTEXT (original using decl) as intended.
But a little further in, copy_fn_p will also check DECL_NONSTATIC_MEMBER_FUNCTION_P and crash. This function used to do nothing for USING_DECL (since its TREE_TYPE wasn't METHOD_TYPE), right? It should continue to do nothing. Come to think of it, how about fixing DECL_NONSTATIC_MEMBER_FUNCTION_P to be false for non-functions rather than messing with all these places that use it? Jason