public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16518] New: mutable specifier only applies to first item in declaration list
@ 2004-07-13 12:08 jan at etpmod dot phys dot tue dot nl
2004-07-13 13:25 ` [Bug c++/16518] [3.5 regression] " bangerth at dealii dot org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: jan at etpmod dot phys dot tue dot nl @ 2004-07-13 12:08 UTC (permalink / raw)
To: gcc-bugs
Consider 't.cpp':
struct foo {
void bar() const { m1=1; m2=1;}
mutable int m1,m2;
};
Compilation (g++ -c t.cpp) gives:
t.cpp: In member function `void foo::bar() const':
t.cpp:3: error: assignment of data-member `foo::m2' in read-only structure
This shows that the mutable specifier applies only to the first item in the
declaration list. Is this the correct behaviour? With previous gcc-versions
both m1 and m2 were considered mutable and this would compile without problems.
There is no mention of a change in wwwdocs/htdocs/gcc-3.5/changes.html. I am
not a native Legalese speaker, so 7.1.1(1) wasn't of much help.
--
Summary: mutable specifier only applies to first item in
declaration list
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jan at etpmod dot phys dot tue dot nl
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-suse-linux
GCC host triplet: i686-suse-linux
GCC target triplet: i686-suse-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16518
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16518] [3.5 regression] mutable specifier only applies to first item in declaration list
2004-07-13 12:08 [Bug c++/16518] New: mutable specifier only applies to first item in declaration list jan at etpmod dot phys dot tue dot nl
@ 2004-07-13 13:25 ` bangerth at dealii dot org
2004-07-13 14:19 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: bangerth at dealii dot org @ 2004-07-13 13:25 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-07-13 13:25 -------
Confirmed, good catch. Doesn't happen very often we have a parser
bug of this kind...
Could someone try to figure out which patch broke this?
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |critical
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Known to fail| |3.5.0
Known to work| |3.4.0
Last reconfirmed|0000-00-00 00:00:00 |2004-07-13 13:25:06
date| |
Summary|mutable specifier only |[3.5 regression] mutable
|applies to first item in |specifier only applies to
|declaration list |first item in declaration
| |list
Target Milestone|--- |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16518
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16518] [3.5 regression] mutable specifier only applies to first item in declaration list
2004-07-13 12:08 [Bug c++/16518] New: mutable specifier only applies to first item in declaration list jan at etpmod dot phys dot tue dot nl
2004-07-13 13:25 ` [Bug c++/16518] [3.5 regression] " bangerth at dealii dot org
@ 2004-07-13 14:19 ` pinskia at gcc dot gnu dot org
2004-07-13 15:20 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-13 14:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-07-13 14:19 -------
Most likely the same bug as PR 16337 too.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |mmitchel at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16518
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16518] [3.5 regression] mutable specifier only applies to first item in declaration list
2004-07-13 12:08 [Bug c++/16518] New: mutable specifier only applies to first item in declaration list jan at etpmod dot phys dot tue dot nl
2004-07-13 13:25 ` [Bug c++/16518] [3.5 regression] " bangerth at dealii dot org
2004-07-13 14:19 ` pinskia at gcc dot gnu dot org
@ 2004-07-13 15:20 ` pinskia at gcc dot gnu dot org
2004-07-13 15:45 ` mark at codesourcery dot com
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-13 15:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-07-13 15:20 -------
>From Phil's regression hunter: Search converges between 2004-06-24-trunk (#471) and 2004-06-26-
trunk (#472).
More evidence that they are the same bug.
Most likely caused by:
2004-06-23 Mark Mitchell <mark@codesourcery.com>
* Make-lang.in (cp/lex.o): Do not depend on cp/lex.h.
(cp/decl.o): Likewise.
(cp/decl2.o): Likewise.
(cp/pt.o): Likewise.
(cp/semantics.o): Likewise.
......
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16518
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16518] [3.5 regression] mutable specifier only applies to first item in declaration list
2004-07-13 12:08 [Bug c++/16518] New: mutable specifier only applies to first item in declaration list jan at etpmod dot phys dot tue dot nl
` (2 preceding siblings ...)
2004-07-13 15:20 ` pinskia at gcc dot gnu dot org
@ 2004-07-13 15:45 ` mark at codesourcery dot com
2004-07-13 21:12 ` cvs-commit at gcc dot gnu dot org
2004-07-13 21:14 ` mmitchel at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: mark at codesourcery dot com @ 2004-07-13 15:45 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mark at codesourcery dot com 2004-07-13 15:45 -------
Subject: Re: [3.5 regression] mutable specifier only applies
to first item in declaration list
pinskia at gcc dot gnu dot org wrote:
>------- Additional Comments From pinskia at gcc dot gnu dot org 2004-07-13 14:19 -------
>Most likely the same bug as PR 16337 too.
>
>
Yes, I think I know what is going on here, and will fix it today.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16518
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16518] [3.5 regression] mutable specifier only applies to first item in declaration list
2004-07-13 12:08 [Bug c++/16518] New: mutable specifier only applies to first item in declaration list jan at etpmod dot phys dot tue dot nl
` (3 preceding siblings ...)
2004-07-13 15:45 ` mark at codesourcery dot com
@ 2004-07-13 21:12 ` cvs-commit at gcc dot gnu dot org
2004-07-13 21:14 ` mmitchel at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-07-13 21:12 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-07-13 21:11 -------
Subject: Bug 16518
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mmitchel@gcc.gnu.org 2004-07-13 21:11:53
Modified files:
gcc/cp : ChangeLog decl.c decl.h parser.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/parse: mutable1.C
Log message:
PR c++/16518
PR c++/16337
* decl.c (grokvardecl): Make declspecs parameter const.
(grokdeclarator): Likewise. Adjust accordingly.
* decl.h (grokdeclarator): Adjust declaration.
* parser.c (cp_parser_init_declarator): Do not clear
decl_specifiers->attributes.
PR c++/16518
* g++.dg/parse/mutable1.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4197&r2=1.4198
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1247&r2=1.1248
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.h.diff?cvsroot=gcc&r1=1.15&r2=1.16
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.227&r2=1.228
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3997&r2=1.3998
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/mutable1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16518
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16518] [3.5 regression] mutable specifier only applies to first item in declaration list
2004-07-13 12:08 [Bug c++/16518] New: mutable specifier only applies to first item in declaration list jan at etpmod dot phys dot tue dot nl
` (4 preceding siblings ...)
2004-07-13 21:12 ` cvs-commit at gcc dot gnu dot org
@ 2004-07-13 21:14 ` mmitchel at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-07-13 21:14 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-07-13 21:14 -------
Fixed in GCC 3.5.0.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16518
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-07-13 21:14 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-13 12:08 [Bug c++/16518] New: mutable specifier only applies to first item in declaration list jan at etpmod dot phys dot tue dot nl
2004-07-13 13:25 ` [Bug c++/16518] [3.5 regression] " bangerth at dealii dot org
2004-07-13 14:19 ` pinskia at gcc dot gnu dot org
2004-07-13 15:20 ` pinskia at gcc dot gnu dot org
2004-07-13 15:45 ` mark at codesourcery dot com
2004-07-13 21:12 ` cvs-commit at gcc dot gnu dot org
2004-07-13 21:14 ` mmitchel 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).