mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
29 lines
431 B
D
29 lines
431 B
D
/***************************************/
|
|
// https://issues.dlang.org/show_bug.cgi?id=17965
|
|
|
|
import core.stdc.math;
|
|
|
|
struct Point{double x,y;}
|
|
|
|
Point foo10()
|
|
{
|
|
Point result = Point(1.0, 2.0);
|
|
return result;
|
|
}
|
|
|
|
Point foo20()
|
|
{
|
|
Point result;
|
|
return result;
|
|
}
|
|
|
|
void main()
|
|
{
|
|
auto p = foo10();
|
|
assert(p.x == 1.0);
|
|
assert(p.y == 2.0);
|
|
|
|
auto q = foo20();
|
|
assert(isnan(q.x));
|
|
assert(isnan(q.y));
|
|
}
|