Skip to content

Commit

Permalink
Merge pull request #4057 from 9rnsr/fix10439
Browse files Browse the repository at this point in the history
Issue 10439 - Deprecate float.min, double.min, real.min
  • Loading branch information
WalterBright committed Oct 10, 2014
2 parents 1184265 + b719b6f commit 0e47db1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/mtype.c
Expand Up @@ -2988,7 +2988,7 @@ Expression *TypeBasic::getProperty(Loc loc, Identifier *ident, int flag)
case Tcomplex80:
case Timaginary80:
case Tfloat80:
deprecation(loc, ".min property is deprecated, use .min_normal instead");
error(loc, ".min property is deprecated, use .min_normal instead");
goto Lmin_normal;
}
}
Expand Down
29 changes: 29 additions & 0 deletions test/fail_compilation/fail10439.d
@@ -0,0 +1,29 @@
/*
TEST_OUTPUT:
---
fail_compilation/fail10439.d(18): Error: .min property is deprecated, use .min_normal instead
fail_compilation/fail10439.d(19): Error: .min property is deprecated, use .min_normal instead
fail_compilation/fail10439.d(20): Error: .min property is deprecated, use .min_normal instead
fail_compilation/fail10439.d(22): Error: .min property is deprecated, use .min_normal instead
fail_compilation/fail10439.d(23): Error: .min property is deprecated, use .min_normal instead
fail_compilation/fail10439.d(24): Error: .min property is deprecated, use .min_normal instead
fail_compilation/fail10439.d(26): Error: .min property is deprecated, use .min_normal instead
fail_compilation/fail10439.d(27): Error: .min property is deprecated, use .min_normal instead
fail_compilation/fail10439.d(28): Error: .min property is deprecated, use .min_normal instead
---
*/

void main()
{
auto a = float.min;
auto b = double.min;
auto c = real.min;

auto d = ifloat.min;
auto e = idouble.min;
auto f = ireal.min;

auto g = cfloat.min;
auto h = cdouble.min;
auto i = creal.min;
}

0 comments on commit 0e47db1

Please sign in to comment.