-
-
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 20916 - Print trace for deprecations triggered inside templates #11839
Conversation
|
Thanks for your pull request, @Geod24! 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#11839" |
|
@ibuclaw @kinke : Do you need to access |
|
I'm almost certain LDC doesn't. |
a9d9d7d to
9edb35b
Compare
src/dmd/dtemplate.d
Outdated
| @@ -5984,6 +5984,10 @@ extern (C++) class TemplateInstance : ScopeDsymbol | |||
| for (TemplateInstance cur = this; cur; cur = cur.tinst) | |||
| { | |||
| ++n_instantiations; | |||
| // Set error here as we don't want it to depend on the number of | |||
| // entries that are being printed. | |||
| cur.errors = true; | |||
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.
What caused this commit?
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 just seems very wrong to have this set only on the templates we show (which can vary depending on -v).
errors has meaning semantic-wise, and the amount of frames we print should not affect the semantic of the code.
I didn't witness anything wrong that prompted the commit, it's just my observation of what should happen.
Note that I believe the diff on test/fail_compilation/deprecations.d (L9 in the old code) is due to this: We don't show the error message twice anymore.
Ideally this shouldn't be in this function, but at least this is more correct now.
This can be useful as a general tool, e.g. for deprecations. Also make the function `extern(D)` as the C++ header generation currently does not handle the `enum` properly and generate nonsense (https://issues.dlang.org/show_bug.cgi?id=21300).
|
This should be good to go (there was a spurious Buildkite failure, re-triggered). |
|
Well this pulls in excessive baggage to the compiler front-end. Copying over Classification from dmd ad verbatim, but now there's a missing module. This occurs in a non-shareable module, so not a big deal, but just highlighting that maybe an another enum would be better. |
This turned out to be way easier than I expected.
@John-Colvin : Want to give this a shot ?
I also think it segv dtoh (and I have an idea where the bug is), but let's see what the auto-tester says...