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

-std=c2x support for C++-style attributes in C-code. #7471

Closed
Iipal opened this issue May 6, 2021 · 6 comments
Closed

-std=c2x support for C++-style attributes in C-code. #7471

Iipal opened this issue May 6, 2021 · 6 comments
Assignees
Labels
Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service Visual Studio Inherited from Visual Studio
Milestone

Comments

@Iipal
Copy link

Iipal commented May 6, 2021

Bug type: Language Service

  • OS and Version: Ubuntu 20.04
  • VS Code Version: 1.56
  • C/C++ Extension Version: 1.3.1

Expected behavior

No errors?
inside union allocator_t->data appears as an unknown data type (2nd screenshot)

Code sample and logs

  • Code sample && Configurations in c_cpp_properties.json: on the screenshot below
  • Logs from running C/C++: Log Diagnostics from the VS Code command palette: shows nothing

image
image

Theme: Darcula with JetBrains Mono font.

@Iipal
Copy link
Author

Iipal commented May 6, 2021

even __auto_type behavior is strange for linux-clang-x64 mode even if __is_identifier says it's valid;

if I change the mode to linux-gcc-x64 as well as a compiler to gcc - then everything works fine. But why in clang-mode it's said that it's a valid identifier but then I see errors?
image

@sean-mcmanus sean-mcmanus self-assigned this May 6, 2021
@sean-mcmanus
Copy link
Collaborator

Can you provide a code sample that compiles with C but gives an error with our extension? I'm seeing gcc and clang both fail to compile

typedef union {
    int i;
} allocator_t [[gnu::transparent_union]];

int main()
{
    return 0;
}

error: expected expression
} allocator_t [[gnu::transparent_union]];

@sean-mcmanus
Copy link
Collaborator

Oh -- I got it to compile with -std=c2x -- we don't support that std version yet. We can use this issue to track adding that.

@sean-mcmanus
Copy link
Collaborator

I've filed a bug against our shared VS parser at https://developercommunity.visualstudio.com/t/C-standard-2x-isnt-supported-by-Intelli/1416530 . After they enable that we can add support on our side.

@sean-mcmanus sean-mcmanus removed their assignment May 8, 2021
@sean-mcmanus sean-mcmanus modified the milestones: Tracking, 1.12 Aug 11, 2022
@sean-mcmanus sean-mcmanus modified the milestones: 1.12, 1.13 Aug 18, 2022
@michelleangela michelleangela modified the milestones: 1.13, On Deck Oct 19, 2022
@TDHolmes
Copy link

I hope this lands soon. My project has started adopting these features and causes syntax errors throughout the project (specifically sized enums)

@sean-mcmanus sean-mcmanus modified the milestones: On Deck, 1.14.4 Feb 25, 2023
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Feb 25, 2023
@sean-mcmanus
Copy link
Collaborator

Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.14.4

@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service Visual Studio Inherited from Visual Studio
Projects
None yet
Development

No branches or pull requests

5 participants