This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++] fix alias and members


On 06/08/2010 02:19 PM, Nathan Sidwell wrote:
On 06/08/10 14:46, Jason Merrill wrote:
On 06/08/2010 05:59 AM, Nathan Sidwell wrote:
+ alias = lookup_attribute ("alias", DECL_ATTRIBUTES (decl)) != 0;
+
+ if (alias && TREE_CODE (decl) == FUNCTION_DECL)
+ record_key_method_defined (decl);

This seems wrong for weak aliases.

I'm not sure. aliases have to be to another symbol defined in the same translation unit.

Not if they're weak references:


static void f() __attribute ((weakref, alias ("g")));

int main()
{
  if (f)
    f();
}

does not require a definition of g. Apparently weakrefs are different from weak aliases; I was previously confusing the two. But this case still involves attribute "alias".

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]