789 – const initialization in forwarding constructors doesn't work

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 789 - const initialization in forwarding constructors doesn't work
Summary: const initialization in forwarding constructors doesn't work
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 normal
Assignee: Walter Bright
URL:
Keywords: rejects-valid, spec
: 512 (view as issue list)
Depends on:
Blocks:
Reported: 2007年01月03日 11:16 UTC by Vladimir Panteleev
Modified: 2014年02月15日 13:22 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Vladimir Panteleev 2007年01月03日 11:16:16 UTC
Spec: http://www.digitalmars.com/d/attribute.html#const
Program:
class C
{
 const int a;
 this()
 {
 a = 3; // ok
 }
 this(int x)
 {
 this(); // ok, forwarding constructor
 }
}
Compiler output:
C:\...\bugs>dmd const.d
const.d(10): constructor const.C.this missing initializer for const field a
Comment 1 Walter Bright 2007年02月12日 03:36:21 UTC
Fixed DMD 1.005
Comment 2 Matti Niemenmaa 2007年04月21日 11:20:43 UTC
*** Bug 512 has been marked as a duplicate of this bug. ***
Comment 3 Thomas Kühne 2007年04月25日 12:57:45 UTC
Added to DStress as
http://dstress.kuehne.cn/run/c/const_47_A.d
http://dstress.kuehne.cn/run/c/const_47_B.d 


AltStyle によって変換されたページ (->オリジナル) /