This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/623: gcc 20001008 rejects {...} component initialization
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/623: gcc 20001008 rejects {...} component initialization
- From: wolfgang dot bangerth at iwr dot uni-heidelberg dot de
- Date: 9 Oct 2000 07:39:22 -0000
- Reply-To: wolfgang dot bangerth at iwr dot uni-heidelberg dot de
- Resent-Cc: gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, jason at gcc dot gnu dot org
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, wolfgang.bangerth@iwr.uni-heidelberg.de
>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: