[Issue 20086] New: -betterC and "Unrestricted use of compile-time features"
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jul 26 20:21:45 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20086
Issue ID: 20086
Summary: -betterC and "Unrestricted use of compile-time
features"
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: maxhaton at gmail.com
-------------Example----------------------------------------------------------
auto demo() //otherfile.d
{
try {
throw new Exception("I am become death");
} catch(Exception e)
{
return e.msg;
}
}
extern(C)
void main()
{
import otherfile : demo;
auto bad = demo(); //This should not compile
enum rad = demo(); //This arguably should as per the
//(vague) wording of the spec
}
------------------------------------------------------------------------------
The specification implies* that arbitrary CTFE should still be possible,
regardless of whether said code actually makes it into the resulting
executable.
* The term "Unrestricted* is not defined, which could make this an enhancement
rather than a bug. Either way this behaviour should be possible (Across module
boundaries, but in the same file raises the question of whether it should
compile or not depend on whether the invalid code is actually used)
--
More information about the Digitalmars-d-bugs
mailing list