D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6671 - core.time compile error, only with -inline -release -noboundscheck
Summary: core.time compile error, only with -inline -release -noboundscheck
Status: RESOLVED DUPLICATE of issue 6502
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Mac OS X
: P2 regression
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-14 14:27 UTC by Peter Alexander
Modified: 2011-09-15 03:01 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Peter Alexander 2011-09-14 14:27:47 UTC
This is a bit of a weird one. In DMD 2.055 the following code:

import core.time;
void main() {}


Gives the compile error:

> dmd test.d -release -inline -noboundscheck
/Library/Compilers/dmd2/osx/bin/../../src/druntime/import/core/time.di(253): Error: template core.time.TickDuration.to(string units,T) if ((units == "seconds" || units == "msecs" || units == "usecs" || units == "hnsecs" || units == "nsecs") && (__traits(isIntegral,T) && T.sizeof >= 4)) does not match any function template declaration
/Library/Compilers/dmd2/osx/bin/../../src/druntime/import/core/time.di(253): Error: template core.time.TickDuration.to(string units,T) if ((units == "seconds" || units == "msecs" || units == "usecs" || units == "hnsecs" || units == "nsecs") && (__traits(isIntegral,T) && T.sizeof >= 4)) cannot deduce template function from argument types !("seconds",long)()


It *only* happens with those three flags. Remove any one and the code compiles fine.

This didn't happen in DMD 2.053 (haven't tried 2.054)
Comment 1 Dmitry Olshansky 2011-09-14 15:45:40 UTC
Looks like http://d.puremagic.com/issues/show_bug.cgi?id=6502 ?
Comment 2 Peter Alexander 2011-09-15 03:01:42 UTC
(In reply to comment #1)
> Looks like http://d.puremagic.com/issues/show_bug.cgi?id=6502 ?

Yes, it looks like you're right. I'll close this one.

*** This issue has been marked as a duplicate of issue 6502 ***