digitalmars.D.bugs - [Issue 1017] New: CTFE doesn't support (string == string)
- d-bugmail puremagic.com (25/25) Mar 03 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1017
- d-bugmail puremagic.com (4/4) Mar 03 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1017
- d-bugmail puremagic.com (19/20) Mar 03 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1017
- d-bugmail puremagic.com (11/12) Mar 04 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1017
- d-bugmail puremagic.com (12/17) Mar 04 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1017
- Don Clugston (13/38) Mar 05 2007 That's correct. I haven't found any configuration where it compiles
- d-bugmail puremagic.com (10/10) Mar 08 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1017
- d-bugmail puremagic.com (9/9) Mar 11 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1017
http://d.puremagic.com/issues/show_bug.cgi?id=1017
Summary: CTFE doesn't support (string == string)
Product: D
Version: 1.007
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla digitalmars.com
ReportedBy: reiner.pope gmail.com
The following code fails in DMD 1.007:
void main()
{
static assert(equals("alphabet", "alphabet"));
}
bool equals(char[] a, char[] b)
{
return (a == b);
}
equality.d(3): static assert (equals("alphabet","alphabet")) is not
evaluatable
at compile time
--
Mar 03 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1017 Put equals() before main() and it should work. --
Mar 03 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1017Put equals() before main() and it should work.It doesn't: --- urxae urxae:~/tmp$ cat test.d bool equals(char[] a, char[] b) { return (a == b); } void main() { static assert(equals("alphabet", "alphabet")); } urxae urxae:~/tmp$ dmd test.d test.d(8): static assert (equals("alphabet","alphabet")) is not evaluatable at compile time --- --
Mar 03 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1017
smjg iname.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |smjg iname.com
Keywords| |rejects-valid
Put equals() before main() and it should work.
Under which platform did you observe a dependency on the order of declarations
in this instance? Clearly not that on which the reporter reported the problem.
--
Mar 04 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1017
fvbommel wxs.nl changed:
What |Removed |Added
----------------------------------------------------------------------------
OS/Version|Windows |All
Put equals() before main() and it should work.
Under which platform did you observe a dependency on the order of declarations
in this instance? Clearly not that on which the reporter reported the problem.
Actually, it could be the same as the reporter. My test of Walter's theory was
done on Linux, while the reporter is appears to be using Windows.
I have no idea if it works on Windows if the order is switched, but I _can_
confirm this bug on Linux, so I'll just change the OS setting to 'all'...
--
Mar 04 2007
d-bugmail puremagic.com wrote:
http://d.puremagic.com/issues/show_bug.cgi?id=1017
fvbommel wxs.nl changed:
What |Removed |Added
----------------------------------------------------------------------------
OS/Version|Windows |All
Put equals() before main() and it should work.
Under which platform did you observe a dependency on the order of declarations
in this instance? Clearly not that on which the reporter reported the problem.
Actually, it could be the same as the reporter. My test of Walter's theory was
done on Linux, while the reporter is appears to be using Windows.
I have no idea if it works on Windows if the order is switched, but I _can_
confirm this bug on Linux, so I'll just change the OS setting to 'all'...
That's correct. I haven't found any configuration where it compiles
under Windows -- and I tried pretty hard to get around this one... for
example, slicing the arrays does not help. Even this (arguably simpler)
variation doesn't work:
bool a()
{
return "x"!="y";
}
void main()
{
static assert( a() );
}
Mar 05 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1017 Added to DStress as http://dstress.kuehne.cn/compile/o/opEquals_07_A.d http://dstress.kuehne.cn/compile/o/opEquals_07_B.d http://dstress.kuehne.cn/compile/o/opEquals_07_C.d http://dstress.kuehne.cn/compile/o/opEquals_07_D.d http://dstress.kuehne.cn/compile/o/opEquals_07_E.d http://dstress.kuehne.cn/compile/o/opEquals_07_F.d --
Mar 08 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1017
thomas-dloop kuehne.cn changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Fixed in DMD-1.009
--
Mar 11 2007









d-bugmail puremagic.com 