dmd icon indicating copy to clipboard operation
dmd copied to clipboard

fix Issue 11048 - Default arguments bypass most attributes check (pure, @safe, @nogc)

Open ibuclaw opened this issue 3 years ago • 6 comments
trafficstars

Variant on #14214 - this use of inlineCopy is exposing a hole in the @safe system.

Checking the testsuite first, then might fold the two together.

ibuclaw avatar Jul 16 '22 09:07 ibuclaw

Thanks for your pull request, @ibuclaw!

Bugzilla references

Auto-close Bugzilla Severity Description
2437 normal ICE(tocsym.c, !needThis()) - default struct argument
2935 normal ICE(out.c) using struct with constructor as function default argument
11048 major Default arguments bypass most attributes check (pure, @safe, @nogc)
13442 minor __gshared default value allowed in @safe function signature

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#14309"

dlang-bot avatar Jul 16 '22 09:07 dlang-bot

This should definitely target stable

thewilsonator avatar Jul 16 '22 09:07 thewilsonator

This should definitely target stable

This should definitely not.

ibuclaw avatar Jul 16 '22 10:07 ibuclaw

Hmm, test in issue 19645 because defaultArgSemantic eagerly folds away the cast expression.

This'll need a bit more plumbing to get right.

ibuclaw avatar Jul 16 '22 11:07 ibuclaw

Are you still working on this @ibuclaw ?

dkorpel avatar Oct 17 '22 09:10 dkorpel