diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-16 16:09:23 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-16 16:09:23 +0000 |
commit | 30b87eb66b0a23a972f6ed649614858b85470dff (patch) | |
tree | 2b4a4284864e77f0905c40d1a718bb9eb360f8ac /gcc/testsuite/g++.dg/other | |
parent | f0fb2d8d67653482f94a0e41d763622893714cfa (diff) |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74702 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/other')
-rw-r--r-- | gcc/testsuite/g++.dg/other/offsetof2.C | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/gcc/testsuite/g++.dg/other/offsetof2.C b/gcc/testsuite/g++.dg/other/offsetof2.C index 64b4fbdc84d..3ab63981d9b 100644 --- a/gcc/testsuite/g++.dg/other/offsetof2.C +++ b/gcc/testsuite/g++.dg/other/offsetof2.C @@ -1,4 +1,4 @@ -// { dg-do run { xfail *-*-* } } +// { dg-do run } // { dg-options -Wold-style-cast } // Copyright (C) 2003 Free Software Foundation, Inc. @@ -6,8 +6,6 @@ // DR273 POD can have an operator&, offsetof is still required to work -// XFAILED - you can't write offsetof without an extension - #include <stddef.h> struct POD1 |