digitalmars.D.bugs - [Issue 772] New: Bogus error using relation operator as static if expression within template
- d-bugmail puremagic.com (33/33) Dec 29 2006 http://d.puremagic.com/issues/show_bug.cgi?id=772
- d-bugmail puremagic.com (8/8) Dec 31 2006 http://d.puremagic.com/issues/show_bug.cgi?id=772
- d-bugmail puremagic.com (9/9) Jan 03 2007 http://d.puremagic.com/issues/show_bug.cgi?id=772
- d-bugmail puremagic.com (9/9) Jul 24 2008 http://d.puremagic.com/issues/show_bug.cgi?id=772
- d-bugmail puremagic.com (23/23) Nov 08 2008 http://d.puremagic.com/issues/show_bug.cgi?id=772
http://d.puremagic.com/issues/show_bug.cgi?id=772 Summary: Bogus error using relation operator as static if expression within template Product: D Version: 0.178 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: ibisbasenji gmail.com Given the following useless test program... -------------------------------------------------- module bug ; template foo (ulong n) { static if (n < 10_LU) { const foo = n ; } else { const foo = n % 10 ; } } void main () { ulong a = 1_LU ; auto omega = foo!(a); } -------------------------------------------------- The compiler will output: bug.d(4): Error: expression (a) < 10LU does not evaluate to a boolean bug.d(15): template instance bool0.main.foo!(a) error instantiating --
Dec 29 2006
http://d.puremagic.com/issues/show_bug.cgi?id=772 Added to DStress as http://dstress.kuehne.cn/compile/o/opCmp_09_A.d http://dstress.kuehne.cn/compile/o/opCmp_09_B.d http://dstress.kuehne.cn/nocompile/o/opCmp_09_C.d http://dstress.kuehne.cn/run/o/opCmp_09_D.d --
Dec 31 2006
http://d.puremagic.com/issues/show_bug.cgi?id=772 bugzilla digitalmars.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED Fixed DMD 1.00 --
Jan 03 2007
http://d.puremagic.com/issues/show_bug.cgi?id=772 davidl 126.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | seems regression on dmd 1.033 --
Jul 24 2008
http://d.puremagic.com/issues/show_bug.cgi?id=772 gide nwawudu.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |INVALID const should be added to the variable declaration, so the error message is correct. Add const and it works in DMD 2.020 and 1.033. module bug ; template foo (ulong n) { static if (n < 10_LU) { const foo = n ; } else { const foo = n % 10 ; } } void main () { const ulong a = 1_LU ; // <- added const auto omega = foo!(a); } --
Nov 08 2008