This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/1505: g++ internal error
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/1505: g++ internal error
- From: wanderer at rsu dot ru
- Date: 24 Dec 2000 04:03:13 -0000
- Reply-To: wanderer at rsu dot ru
>Number: 1505
>Category: c++
>Synopsis: g++ internal error
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Sat Dec 23 20:06:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Vladimir Merzliakov
>Release: version 2.97 20001223 (experimental)
>Organization:
>Environment:
Page http://www.codesourcery.com/gcc-compile.shtml
>Description:
/tmp/@17169.7.cc: In member function `void V::val(int) const':
/tmp/@17169.7.cc:4: assignment of data-member `V::val_' in read-only structure
/tmp/@17169.7.cc: In function `int main()':
/tmp/@17169.7.cc:22: Internal compiler error in convert_nontype_argument, at
cp/pt.c:3088
Please submit a full bug report.
See for instructions.
>How-To-Repeat:
>Fix:
work around the problem (see source): add member-function
struct U : public V {
int val() { return V::val(); };
};
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="test2.cc"
Content-Disposition: inline; filename="test2.cc"
struct V {
V() : val_(0) {};
int val() const { return val_; };
void val(int newval) const { val_ = newval; };
private:
int val_;
};
struct U : public V {
U() : V() {};
};
template< int (U::*g)() const>
struct W {
int const val() {
U u;
return (u.*g)();
};
};
int main() {
return W<&U::val>::val();
};