public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13529] New: [3.4 regression] offsetof() with member-designator containing member access broken
@ 2003-12-31  3:33 dbaron at dbaron dot org
  2003-12-31  7:51 ` [Bug c++/13529] " dbaron at dbaron dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: dbaron at dbaron dot org @ 2003-12-31  3:33 UTC (permalink / raw)
  To: gcc-bugs

An offsetof() expression with a member-designator that contains member access is
broken for C++.  It works correctly in C.  This is a regression in the past few
months -- it's broken in the 2003-12-17 snapshot (and in cvs from a few hours
ago), and it worked on 2003-09-14.

-- 
           Summary: [3.4 regression] offsetof() with member-designator
                    containing member access broken
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dbaron at dbaron dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/13529] [3.4 regression] offsetof() with member-designator containing member access broken
  2003-12-31  3:33 [Bug c++/13529] New: [3.4 regression] offsetof() with member-designator containing member access broken dbaron at dbaron dot org
@ 2003-12-31  7:51 ` dbaron at dbaron dot org
  2003-12-31  7:57 ` dbaron at dbaron dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dbaron at dbaron dot org @ 2003-12-31  7:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dbaron at dbaron dot org  2003-12-31 03:25 -------
Created an attachment (id=5384)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5384&action=view)
C++ testcase (broken)


-- 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/13529] [3.4 regression] offsetof() with member-designator containing member access broken
  2003-12-31  3:33 [Bug c++/13529] New: [3.4 regression] offsetof() with member-designator containing member access broken dbaron at dbaron dot org
  2003-12-31  7:51 ` [Bug c++/13529] " dbaron at dbaron dot org
@ 2003-12-31  7:57 ` dbaron at dbaron dot org
  2003-12-31  8:53 ` dbaron at dbaron dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dbaron at dbaron dot org @ 2003-12-31  7:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dbaron at dbaron dot org  2003-12-31 03:25 -------
Created an attachment (id=5385)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5385&action=view)
C testcase (works fine)


-- 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/13529] [3.4 regression] offsetof() with member-designator containing member access broken
  2003-12-31  3:33 [Bug c++/13529] New: [3.4 regression] offsetof() with member-designator containing member access broken dbaron at dbaron dot org
  2003-12-31  7:51 ` [Bug c++/13529] " dbaron at dbaron dot org
  2003-12-31  7:57 ` dbaron at dbaron dot org
@ 2003-12-31  8:53 ` dbaron at dbaron dot org
  2004-01-01  0:32 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dbaron at dbaron dot org @ 2003-12-31  8:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dbaron at dbaron dot org  2003-12-31 03:33 -------
I should be a little clearer.  The bug is that attachment 5384 fails to compile
with the error:

/usr/local/gcc-3.4-20031231/bin/g++ offsetof.cpp
offsetof.cpp: In function `int main()':
offsetof.cpp:9: error: `.' cannot appear in a constant-expression


-- 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/13529] [3.4 regression] offsetof() with member-designator containing member access broken
  2003-12-31  3:33 [Bug c++/13529] New: [3.4 regression] offsetof() with member-designator containing member access broken dbaron at dbaron dot org
                   ` (2 preceding siblings ...)
  2003-12-31  8:53 ` dbaron at dbaron dot org
@ 2004-01-01  0:32 ` pinskia at gcc dot gnu dot org
  2004-01-04 22:48 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-01  0:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-01 00:32 -------
Confirmed, looks like Mark forgot about the dot operator when he did this patch:
2003-12-16  Mark Mitchell  <mark@codesourcery.com>

        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.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2004-01-01 00:32:13
               date|                            |
   Target Milestone|---                         |3.4.0


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/13529] [3.4 regression] offsetof() with member-designator containing member access broken
  2003-12-31  3:33 [Bug c++/13529] New: [3.4 regression] offsetof() with member-designator containing member access broken dbaron at dbaron dot org
                   ` (3 preceding siblings ...)
  2004-01-01  0:32 ` pinskia at gcc dot gnu dot org
@ 2004-01-04 22:48 ` mmitchel at gcc dot gnu dot org
  2004-01-05  1:53 ` mmitchel at gcc dot gnu dot org
  2004-01-05  1:53 ` cvs-commit at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-01-04 22:48 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/13529] [3.4 regression] offsetof() with member-designator containing member access broken
  2003-12-31  3:33 [Bug c++/13529] New: [3.4 regression] offsetof() with member-designator containing member access broken dbaron at dbaron dot org
                   ` (4 preceding siblings ...)
  2004-01-04 22:48 ` mmitchel at gcc dot gnu dot org
@ 2004-01-05  1:53 ` mmitchel at gcc dot gnu dot org
  2004-01-05  1:53 ` cvs-commit at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-01-05  1:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-01-05 01:53 -------
Fixed in GCC 3.4.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/13529] [3.4 regression] offsetof() with member-designator containing member access broken
  2003-12-31  3:33 [Bug c++/13529] New: [3.4 regression] offsetof() with member-designator containing member access broken dbaron at dbaron dot org
                   ` (5 preceding siblings ...)
  2004-01-05  1:53 ` mmitchel at gcc dot gnu dot org
@ 2004-01-05  1:53 ` cvs-commit at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-01-05  1:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-01-05 01:53 -------
Subject: Bug 13529

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-01-05 01:52:58

Modified files:
	gcc/cp         : ChangeLog 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/parse: offsetof3.C 

Log message:
	PR c++/13529
	* parser.c (cp_parser_postfix_expression): Allow "." to appear in
	an offsetof expression.
	
	PR c++/13529
	* g++.dg/parse/offsetof3.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3850&r2=1.3851
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3333&r2=1.3334
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/offsetof3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-01-05  1:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-31  3:33 [Bug c++/13529] New: [3.4 regression] offsetof() with member-designator containing member access broken dbaron at dbaron dot org
2003-12-31  7:51 ` [Bug c++/13529] " dbaron at dbaron dot org
2003-12-31  7:57 ` dbaron at dbaron dot org
2003-12-31  8:53 ` dbaron at dbaron dot org
2004-01-01  0:32 ` pinskia at gcc dot gnu dot org
2004-01-04 22:48 ` mmitchel at gcc dot gnu dot org
2004-01-05  1:53 ` mmitchel at gcc dot gnu dot org
2004-01-05  1:53 ` cvs-commit at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).