[Issue 3924] New: nothrow ignored in some situations
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Mar 10 06:53:27 PST 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3924
Summary: nothrow ignored in some situations
Product: D
Version: 2.041
Platform: x86
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2010-03-10 06:53:26 PST ---
The following programs compile and raise exceptions even if the
functions/delegates are marked as nothrow:
------------------
void main() {
nothrow void delegate() c = { throw new Exception(""); };
c();
}
------------------
nothrow auto foo() {
throw new Exception("");
}
void main() {
foo();
}
------------------
nothrow auto foo() {
auto c = { throw new Exception(""); };
c();
}
void main() {
foo();
}
---------------------------------
While this code that looks correct doesn't compile:
pure void foo(pure nothrow void delegate(int) callable) {
callable(5);
}
void main() {
pure nothrow void bar(int x) {}
foo(&bar);
}
With the first error:
test1.d(1): basic type expected, not pure
--
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