Similar to issue 21830, but uses selective imports. --- module mod; static if(1) { int fun()(int a) { return a; } } deprecated double fun()(double a) { return a; } --- module main; int inst(T)(T x) { import selective : fun; // template 'fun' is deprecated return fun(x); } int main() { return inst(0); // instantiated from here } ---
Correction on test: module mod; static if(1) { int fun()(int a) { return a; } } deprecated { double fun()(double a) { return a; } } --- module main; int inst(T)(T x) { import selective : fun; // template 'fun' is deprecated return fun(x); } int main() { return inst(0); // instantiated from here }
@ibuclaw created dlang/dmd pull request #12442 "fix Issue 21832 - Wrong deprecation message when importing non-deprecated template in static condition" fixing this issue: - fix Issue 21832 - Wrong deprecation message when importing non-deprecated template in static condition https://github.com/dlang/dmd/pull/12442
dlang/dmd pull request #12442 "fix Issue 21832 - Wrong deprecation message when importing non-deprecated template in static condition" was merged into master: - d029cc4c9fa06d96470c933da2d4c33614fa3c18 by Iain Buclaw: fix Issue 21832 - Wrong deprecation message when importing non-deprecated template in static condition https://github.com/dlang/dmd/pull/12442