gcc/gcc/ginclude
Mark Mitchell 263ee05239 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
2003-12-16 16:09:23 +00:00
..
float.h float.h, [...]: GCC, not GNU CC. 2003-03-13 02:58:40 +00:00
iso646.h float.h, [...]: GCC, not GNU CC. 2003-03-13 02:58:40 +00:00
stdarg.h float.h, [...]: GCC, not GNU CC. 2003-03-13 02:58:40 +00:00
stdbool.h float.h, [...]: GCC, not GNU CC. 2003-03-13 02:58:40 +00:00
stddef.h re PR c++/13275 (Implementation of offsetof macro) 2003-12-16 16:09:23 +00:00
varargs.h