Thread overview |
---|
December 20, 2008 [Issue 2526] New: non-const initializer to constant accepted inside template | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=2526 Summary: non-const initializer to constant accepted inside template Product: D Version: 1.037 Platform: PC OS/Version: Linux Status: NEW Keywords: accepts-invalid, wrong-code Severity: major Priority: P2 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: kamm-removethis@incasoftware.de This compiles and fails the assert: template T() { const o = new Object; } void main() { assert(T!().o is T!().o); } It should not compile, as const o = new Object; also fails with "Error: non-constant expression new Object". The assert is triggered because DMD emits a call to new for each mention of T!().o inside a function. -- |
January 30, 2012 [Issue 2526] (D1 only) non-const initializer to constant accepted inside template | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2526 --- Comment #1 from yebblies <yebblies@gmail.com> 2012-01-30 17:22:56 EST --- D2 bug is duplicate of issue 2414. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 30, 2012 [Issue 2526] (D1 only) non-const initializer to constant accepted inside template | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2526 yebblies <yebblies@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomas@famolsen.dk --- Comment #2 from yebblies <yebblies@gmail.com> 2012-01-30 17:23:06 EST --- *** Issue 2706 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 02, 2012 [Issue 2526] (D1 only) non-const initializer to constant accepted inside template | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2526 yebblies <yebblies@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nfxjfg@gmail.com --- Comment #3 from yebblies <yebblies@gmail.com> 2012-02-02 15:32:19 EST --- *** Issue 4397 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation