diff --git a/src/dmd/func.d b/src/dmd/func.d index db71082713c7..d27eaac3e72a 100644 --- a/src/dmd/func.d +++ b/src/dmd/func.d @@ -2749,7 +2749,8 @@ extern (C++) FuncDeclaration resolveFuncCall(const ref Loc loc, Scope* sc, Dsymb { assert(fd); - if (fd.checkDisabled(loc, sc)) + // remove when deprecation period of class allocators and deallocators is over + if (fd.isNewDeclaration() && fd.checkDisabled(loc, sc)) return null; bool hasOverloads = fd.overnext !is null; diff --git a/test/fail_compilation/fail19419.d b/test/fail_compilation/fail19419.d new file mode 100644 index 000000000000..f25531fca655 --- /dev/null +++ b/test/fail_compilation/fail19419.d @@ -0,0 +1,21 @@ +/* +TEST_OUTPUT: +--- +fail_compilation/fail19419.d(20): Error: none of the overloads of `this` are callable using argument types `(int)`, candidates are: +fail_compilation/fail19419.d(12): `fail19419.B.this()` +fail_compilation/fail19419.d(14): `fail19419.B.this(string s)` +--- +*/ + +struct B +{ + @disable this(); + + this(string s) + {} +} + +void main() +{ + auto b = B(3); +}