digitalmars.D.bugs - [Issue 2568] New: Warning Inside Template Causes Instantiation Error
- d-bugmail puremagic.com (35/35) Jan 07 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2568
- d-bugmail puremagic.com (15/15) Jun 10 2011 http://d.puremagic.com/issues/show_bug.cgi?id=2568
http://d.puremagic.com/issues/show_bug.cgi?id=2568 Summary: Warning Inside Template Causes Instantiation Error Product: D Version: 1.039 Platform: PC OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: minor Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: business3 twistedpairgaming.com ----------------- void foo(T)(T arg) { int i = 999; byte b = i; } void main() { float f; foo(f); } ----------------- The above code compiles correctly with warnings disabled. But when warnings are enabled, an template instantiation error is generated: ----------------- warning - main.d(4): Error: implicit conversion of expression (i) of type int to byte can cause loss of data main.d(10): template instance main_.foo!(float) error instantiating ----------------- errors. --
Jan 07 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2568 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |yebblies gmail.com Resolution| |INVALID In dmd 1.063 this no longer generates the error, but does cause the warning. The failed compilation is in line with dmd's treatment of errors. The -wi switch has since been introduced for the case you do not want to treat warnings as error. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 10 2011