c++/623: gcc 20001008 rejects {...} component initialization
wolfgang.bangerth@iwr.uni-heidelberg.de
wolfgang.bangerth@iwr.uni-heidelberg.de
Mon Oct 9 00:46:00 GMT 2000
>Number: 623
>Category: c++
>Synopsis: gcc 20001008 rejects {...} component initialization
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Mon Oct 09 00:46:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Wolfgang Bangerth
>Release: unknown-1.0
>Organization:
>Environment:
gcc 2.97 20001002 and 20001008
>Description:
The 20001002/20001008 snapshots rejects the following, legal code:
-----------------------------
struct V {};
struct X { V v; };
const X x = { V() };
-----------------------------
The error message is
var/xt> c++ -c y.cc
y.cc: In function `void __static_initialization_and_destruction_0(int, int)':
y.cc:4: non-lvalue in unary `&'
which is neither helpful nor correct. If the `const' specifier
is removed from the variable, everything is fine.
>How-To-Repeat:
Compile with `c++ -c y.cc'
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list