-
-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Issue 19285 - False GC positive caused by AddressOf inside typeof… #14195
Conversation
|
Thanks for your pull request, @maxhaton! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#14195" |
|
Test case? |
added |
|
What about? enum Unused3 = __traits(compiles , &inner); |
Fixed and added |
… polluting global semantic state. This patch also adds a new method isFromSpeculativeSemanticContext to the Scope struct to avoid repition of this logic in the compiler.
| * | ||
| * Returns: `true` if this `Scope` is known to be from one of these speculative contexts | ||
| */ | ||
| extern(C++) bool isFromSpeculativeSemanticContext() scope |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A detail but the name is really long, why not isSpeculative?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, why C++? Does ldc use this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not C++? The second part I cannot answer causally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep internal semantic machinery internal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't machinery as per se, this could be useful for culling emitted symbols or more weakly a speculative symbol may still need to be emitted into the binary but doesn't need to be optimized because it'll never be called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's still internal to the front-end (see dmd.dtemplate.needsCodegen).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
… polluting global semantic state.