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

struct cannot be used as a part of a type cast. #230

Closed
matter123 opened this issue Jun 7, 2019 · 3 comments
Closed

struct cannot be used as a part of a type cast. #230

matter123 opened this issue Jun 7, 2019 · 3 comments
Labels
🐛 Bug Something isn't working

Comments

@matter123
Copy link
Collaborator

matter123 commented Jun 7, 2019

From:
microsoft/vscode-cpptools#3741

Description of Issue:
When struct is a part of a type cast it does not close the struct head until the ;.

Possible Solution:
Temporary:

  • Prevent the struct declaration pattern from being preceded by (
  • End the struct declaration at )

Permanent:

  • Prevent struct declarations from happening inside of the function definition context

Example Code:

void func()
{
    struct var** thing = (struct var**)func(); //comment
}

Example image:
Screenshot from 2019-06-07 11-35-33

@matter123 matter123 added the 🐛 Bug Something isn't working label Jun 7, 2019
jeff-hykin added a commit that referenced this issue Jun 12, 2019
@jeff-hykin
Copy link
Owner

Temp fix for this by including the parameter struct syntax inside of the () blocks. Probably need to make sure this is covered for enums/unions too before closing this issue.

@matter123
Copy link
Collaborator Author

matter123 commented Jun 12, 2019

Yeah there is an issue with class and union
Screenshot from 2019-06-12 13-21-02

Edit: for copy/paste:

void func()
{
    class var** thing = (class var**)func(); //comment
    struct var** thing = (struct var**)func(); //comment
    enum var** thing = (enum var**)func(); //comment
    union var** thing = (union var**)func(); //comment
}

jeff-hykin added a commit that referenced this issue Jun 20, 2019
@jeff-hykin
Copy link
Owner

Alright this should be fully fixed with the latest change and should be pushed to the extension in the next day or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants