From: Jason Merrill Date: Sat, 6 Jun 1998 18:13:12 +0000 (+0000) Subject: * search.c (envelope_add_decl): Tweak for implicit typename. X-Git-Tag: prereleases/egcs-1.1-prerelease~896 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3070ba0b8633736c0b12b463e3dbc968e79e39c9;p=thirdparty%2Fgcc.git * search.c (envelope_add_decl): Tweak for implicit typename. From-SVN: r20264 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 65a4819edbb4..cec9536bf723 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,7 @@ 1998-06-05 Jason Merrill + * search.c (envelope_add_decl): Tweak for implicit typename. + * call.c (joust): Also warn about confusing conversion op/constructor overload resolution. diff --git a/gcc/cp/search.c b/gcc/cp/search.c index d2ad247d38ae..6d2a5309ff59 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -3333,6 +3333,12 @@ envelope_add_decl (type, decl, values) tree name = DECL_NAME (decl); int dont_add = 0; + /* Yet Another Implicit Typename Kludge: Since we don't tsubst + the members for partial instantiations, DECL_CONTEXT (decl) is wrong. + But pretend it's right for this function. */ + if (processing_template_decl) + type = DECL_REAL_CONTEXT (decl); + /* virtual base names are always unique. */ if (VBASE_NAME_P (name)) *values = NULL_TREE; @@ -3354,10 +3360,7 @@ envelope_add_decl (type, decl, values) warning ("in this context"); } - context = (TREE_CODE (value) == FUNCTION_DECL - && DECL_VIRTUAL_P (value)) - ? DECL_CLASS_CONTEXT (value) - : DECL_CONTEXT (value); + context = DECL_REAL_CONTEXT (value); if (context == type) {