Skip to content
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 22127 - compiler assertion failure parser on UDA and functi… #13368

Closed
wants to merge 6 commits into from

Conversation

WalterBright
Copy link
Member

…on literal

@dlang-bot
Copy link
Contributor

dlang-bot commented Nov 28, 2021

Thanks for your pull request, @WalterBright!

Bugzilla references

Auto-close Bugzilla Severity Description
22127 normal compiler assertion failure parser on UDA and function literal
22398 critical importC: Error: unknown, when compiling source with non-constant initializer.
22428 normal importC: static variables/functions emit global symbols
22432 major ImportC: casting result of postfix operator on a parenthesized expression to a typedef’d type is parsed incorrectly

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 "stable + dmd#13368"

@thewilsonator
Copy link
Contributor

stable

@WalterBright
Copy link
Member Author

It's neither a regression nor critical.

@thewilsonator
Copy link
Contributor

ICEs go to stable (unless it _only _occurs in master which presumably this doesn't)

src/dmd/parse.d Outdated
(*tf.parameterList.parameters)[0].userAttribDecl = new AST.UserAttributeDeclaration(udas, as);
if (tpl_ is null || tpl_.members.dim != 1)
{
error("user-defined attributes not allowed for `alias` declarations");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error("user-defined attributes not allowed for `alias` declarations");
error("user-defined attributes are not allowed on `alias` declarations");

@maxhaton
Copy link
Member

This catches the segfault which is good but the code should be allowed, right? If it's allowed the error message needs to propose an alternative (Identity template?)

@RazvanN7
Copy link
Contributor

RazvanN7 commented Dec 1, 2021

@WalterBright yes, ICEs should target stable.

@RazvanN7
Copy link
Contributor

RazvanN7 commented Dec 9, 2021

ping @WalterBright

@RazvanN7
Copy link
Contributor

RazvanN7 commented Jan 5, 2022

@WalterBright Can you please address @maxhaton 's comment and target stable so that we can move on with this PR?

@RazvanN7
Copy link
Contributor

This catches the segfault which is good but the code should be allowed, right? If it's allowed the error message needs to propose an alternative (Identity template?)

@maxhaton I'm not really sure what the purpose if having an UDA on an alias is. Aliases are merely placeholders for the actual symbol, so having the UDA directly on the aliasee would be the alternative. Anyway, whatever path we choose to take should the topic of a different PR.

@RazvanN7
Copy link
Contributor

I screwed up the rebase, but I opened a new PR with this: #13566

@RazvanN7 RazvanN7 closed this Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants