From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19717 invoked by alias); 13 Jul 2004 12:08:29 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 19699 invoked by uid 48); 13 Jul 2004 12:08:25 -0000 Date: Tue, 13 Jul 2004 12:08:00 -0000 From: "jan at etpmod dot phys dot tue dot nl" To: gcc-bugs@gcc.gnu.org Message-ID: <20040713120822.16518.jan@etpmod.phys.tue.nl> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/16518] New: mutable specifier only applies to first item in declaration list X-Bugzilla-Reason: CC X-SW-Source: 2004-07/txt/msg01478.txt.bz2 List-Id: 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