summaryrefslogtreecommitdiff
path: root/gcc/cp/lex.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@gcc.gnu.org>2004-06-01 08:12:23 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-06-01 08:12:23 -0700
commit7a3ea2011be31e937186df05335f665a8a983028 (patch)
treebfb9b2da79e35521eae05ac845e476d726baa281 /gcc/cp/lex.c
parentc4ec6988bc930288ea6c7fa2ec67a6cfbd0c0d73 (diff)
downloadgcc-7a3ea2011be31e937186df05335f665a8a983028.tar.gz
c-parse.in (OFFSETOF, [...]): New.
* c-parse.in (OFFSETOF, offsetof_member_designator): New. (primary): Handle offsetof. Add error productions for faux functions. Move component_ref objc checking to build_component_ref. (reswords): Add offsetof. (rid_to_yy): Add offsetof. * c-tree.h (build_offsetof): Declare. * c-common.h (objc_is_public): Declare. * c-typeck.c (build_component_ref): Check objc_is_public. (build_offsetof): New. * stub-objc.c (objc_is_public): New. * objc/objc-act.c, objc/objc-act.h (objc_is_public): Rename from is_public. * ginclude/stddef.h (offsetof): Use __builtin_offsetof. * doc/extend.texi (Offsetof): Move from C++ section to C section and rewrite for __builtin_offsetof. cp/ * lex.c (reswords): Rename "__offsetof" to "__builtin_offsetof". * parser.c (struct cp_parser): Remove in_offsetof. (cp_parser_new): Don't set it. (cp_parser_unary_expression): Don't check it. (cp_parser_postfix_open_square_expression): Split out from ... (cp_parser_postfix_expression): ... here. (cp_parser_postfix_dot_deref_expression): Likewise. (cp_parser_builtin_offsetof): New. (cp_parser_primary_expression): Use it. testsuite/ * g++.dg/template/dependent-expr4.C: Use __builtin_offsetof. From-SVN: r82549
Diffstat (limited to 'gcc/cp/lex.c')
-rw-r--r--gcc/cp/lex.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 66e45ed905a..d10fa2e3758 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -253,6 +253,7 @@ static const struct resword reswords[] =
{ "__asm__", RID_ASM, 0 },
{ "__attribute", RID_ATTRIBUTE, 0 },
{ "__attribute__", RID_ATTRIBUTE, 0 },
+ { "__builtin_offsetof", RID_OFFSETOF, 0 },
{ "__builtin_va_arg", RID_VA_ARG, 0 },
{ "__complex", RID_COMPLEX, 0 },
{ "__complex__", RID_COMPLEX, 0 },
@@ -266,8 +267,6 @@ static const struct resword reswords[] =
{ "__inline__", RID_INLINE, 0 },
{ "__label__", RID_LABEL, 0 },
{ "__null", RID_NULL, 0 },
- { "__offsetof", RID_OFFSETOF, 0 },
- { "__offsetof__", RID_OFFSETOF, 0 },
{ "__real", RID_REALPART, 0 },
{ "__real__", RID_REALPART, 0 },
{ "__restrict", RID_RESTRICT, 0 },