This is the mail archive of the gcc-bugs@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]

[Bug c++/13275] [3.4 regression] Implementation of offsetof macro


------- Additional Comments From gdr at integrable-solutions dot net  2003-12-04 01:31 -------
Subject: Re:  [3.4 regression] Implementation of offsetof macro

"nathan at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| Consider that TYPE might be a template or dependent type, and you
| need to know that when parsing the .member bit. 

Yes, but then, it is not really different from sizeof T::member.
__offsetof__(T, member) does record the fact that it is dependent by
the very presence of a dependent T as operand.

| It is simplest and most
| robust to make the construct look somewhat like obj.member

I don't think it is more robust.  And I'm not convinced that it is
simpler, because we still need to get a constant expression out of
that, and when folding we will be basically destructuring obj.member
into parts -- to get something analogue to (type, member), which is
where started from.

-- Gaby


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13275


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