Open hctim opened 4 years ago
Thanks for reporting this. I've filed a bug on VS at https://developercommunity.visualstudio.com/content/problem/796872/cc-intellisense-in-gccclang-mode-shows-attribute-c.html .
I have also run into this issue. I went to upvote the linked bug above, but when I went to sign up, I couldn't unsubscribe from the VS promotional materials. Looked like there might have been an invisible check mark. Running Chrome 85. I didn't want to sign up and receive promotional material.
@tristan957 I'm not familiar with the VS promotional materials you're describing, but you could file a complaint at https://developercommunity.visualstudio.com/ , and/or add an email filter.
For some reason it didn't ask me when I signed up today, so I sent an upvote to the upstream issue. I am working in a codebase close to the Linux kernel, so there is a lot of interest to me in seeing more of these attribute issues fixed up although the amount of people who would appreciate the fixes is probably close to 0. Thanks for the upstream report :)
Using
#if __INTELLISENSE__
#pragma diag_suppress 1094
#endif
in the TU is a potential workaround (i.e. it could be added to a forcedInclude file in your configuration).
https://github.com/microsoft/vscode-cpptools/releases/tag/0.30.0-insiders5 has IntelliSense error codes added.
Sweet. I will be looking at that when it hits stable :). Should help tremendously in certain parts of the code.
@tristan957 1.0.0 should be released Monday...should be identical to 0.30.0-insiders5 except for the version changes. diag_suppress should work with 0.29.0 and older as well, but you'd need to know the internal/unreported error code to use.
I also went through the same issue but yeah, doing something like
#if defined(__INTELLISENSE__)
#pragma diag_suppress <error_code>
#endif
this is probably the best way to disable any false positives atm I guess
Type: LanguageService Describe the bug
ms-vscode.cpptools
Version 0.26.0: October 15, 2019
The constructor function attribute takes an optional priority field. This is incorrectly flagged as an error by IntelliSense with the following error:
attribute "constructor" does not take arguments
.To Reproduce Open file with the following function declaration. Watch IntelliSense mark it as a problem with the above error.
Expected behavior No error should appear, as
constructor
takes an optional integer argument to specify priority.