aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.h
diff options
context:
space:
mode:
authorMark Mitchell <mmitchel@gcc.gnu.org>2003-12-16 16:09:23 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-12-16 16:09:23 +0000
commit263ee052390366c2476124b43a53cec7e5540187 (patch)
tree2b4a4284864e77f0905c40d1a718bb9eb360f8ac /gcc/c-common.h
parentff5034c5be89c496e39b79b52cd496130c51fdb2 (diff)
downloadgcc-263ee052390366c2476124b43a53cec7e5540187.zip
gcc-263ee052390366c2476124b43a53cec7e5540187.tar.gz
gcc-263ee052390366c2476124b43a53cec7e5540187.tar.bz2
re PR c++/13275 (Implementation of offsetof macro)
PR c++/13275 * c-common.h (enum rid): Add RID_OFFSETOF. * c-parser.in (rid_to_yy): Ignore RID_OFFSETOF. * ginclude/stddef.h (offsetof): Reimplement for C++, using __offsetof__. * doc/extend.texi: Document __offsetof__. PR c++/13275 * lex.c (reswords): Add "__offsetof" and "__offsetof__". * parser.c (cp_parser): Add in_offsetof_p. (cp_parser_new): Initialize it. (cp_parser_primary_expression): Handle __offsetof__ (...). (cp_parser_postfix_expression): Allow casts to pointer type and uses of "->" in a constant expression if implementing offsetof. (cp_parser_unary_expression): Allow the use of "&" in a constant expression if implementing offsetof. PR c++/13275 * g++.dg/other/offsetof2.C: Remove XFAIL. * g++.dg/parse/offsetof1.C: New test. * g++.gd/parse/offsetof2.C: Likewise. From-SVN: r74702
Diffstat (limited to 'gcc/c-common.h')
-rw-r--r--gcc/c-common.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 326fe51..28e8356 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -88,9 +88,10 @@ enum rid
RID_PUBLIC, RID_PRIVATE, RID_PROTECTED,
RID_TEMPLATE, RID_NULL, RID_CATCH,
RID_DELETE, RID_FALSE, RID_NAMESPACE,
- RID_NEW, RID_OPERATOR, RID_THIS,
- RID_THROW, RID_TRUE, RID_TRY,
- RID_TYPENAME, RID_TYPEID, RID_USING,
+ RID_NEW, RID_OFFSETOF, RID_OPERATOR,
+ RID_THIS, RID_THROW, RID_TRUE,
+ RID_TRY, RID_TYPENAME, RID_TYPEID,
+ RID_USING,
/* casts */
RID_CONSTCAST, RID_DYNCAST, RID_REINTCAST, RID_STATCAST,