[Issue 9980] New: [CTFE] Allow interpreting function with variable arguments when their values aren't used
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Apr 23 02:56:58 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9980
Summary: [CTFE] Allow interpreting function with variable
arguments when their values aren't used
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: verylonglogin.reg at gmail.com
--- Comment #0 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2013-04-23 13:56:57 MSD ---
---
int f(int)
{
return 1;
}
int g(bool first, int a, int b)
{
return first ? a : b;
}
void main()
{
int i;
static assert(f(i) == 1);
static assert(g(true, 2, i) == 2);
static assert(g(false, i, 3) == 3);
}
---
Currently code fails with "variable i cannot be read at compile time" errors.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list