-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
<intrin.h>: clang-tidy and "expected function body after function declarator" #1300
Comments
Thanks for reporting this issue - while |
Thanks for the prompt response! I was hesitant to report the issue here as I couldn't find |
Given that we have independent reports from users about two different problems caused by this change within two days of the preview release, I think we should make this a priority and try to get it fixed for 16.8. |
I believe I can fix this (with a change entirely within |
I believe I've fixed this with Microsoft-internal MSVC-PR-278849 which will ship in VS 2019 16.9 Preview 2. |
Thanks for getting this issue fixed! Since the change won't be making it into 16.8, can you share with us any details of what the fix was? It might make it easier for us to work around the issue ourselves. |
@ParthogenDavid Here's the actual diff for the fix we applied. |
Thanks, that's perfect! |
I'm a bit confused. Does this mean that 16.8 is incompatible with clang and we will have no fix for the next months? Using VC 2019 16.9 Preview is not an option for me. |
In my experience Clang itself works fine, it's libclang (and tools based on it) which have issues. (Why there's a difference in behavior between Clang and libclang I couldn't tell you.) (Also for what it's worth, the fix does not appear to have made it into 16.9 Preview 1.) |
See #1300 (comment) above:
|
Good to know the difference in clang vs. libclang. I didn't know that. Unfortunately I'm interested in using clang tools, not the clang compiler. For me this is a blocker to use 16.8. Seems like I have to skip this release and wait for 16.9. Microsoft seems to be committed to support clang tools as well. Would regression tests with e.g. clang-tidy for the STL make sense? |
It could be reasonable to add such a regression test, especially if (1) clang-tidy is installed along with clang-cl by VS (haven't checked), (2) an "include all headers" test finds issues like this, and (3) it doesn't take exceptionally long to run, or constantly fails for essentially spurious reasons. We're somewhat wary of increasing our "support matrix", but it seems like using clang-tidy with the STL is a common scenario. |
I get this issue whenever I try to use this extension: https://github.com/Viladoman/StructLayout
|
Thank you for the workaround! I went to use clang and was confused for a sec before finding your diff - compiles without the intrin file error now. Kinda super new to using clang and thought my compilation of llvm was screwed up lol |
Terrible workaround for microsoft/STL#1300
Terrible workaround for microsoft/STL#1300
Apply fix for microsoft/STL#1300
Me too |
Shiboken also uses libclang, everything based on it breaks in 16.8.3 (latest release). Why isn't this being hotfixed into 16.8? |
I agree this should be hotfixed. Breaks my code generation as well (https://github.com/haikarainen/WIR.Framework) |
Since I use |
Agree on need for hotfix to 16.8, all progress on LLVM.NET is now halted as we can't build anymore. Installing the preview isn't an option as the environments for GitHub Action builds don't support the preview releases of VS. Only the release versions. |
Apparently Microsoft introduced a bug Visual Studio's distribution. More at: microsoft/STL#1300 Revert this when things get better.
Hotfix would be appropriate. For now we can use temporary hack (copied from mono/CppSharp) fix_intrin.ps1:
|
I'm still waiting for an official stable release for this fix. Anyone know if VS 16.9 GA is supposed to be happening soon or not? |
VS 2019 16.9 was released for production use yesterday (March 2). |
Describe the bug
After updating to 16.8.0 Preview 3, I've been getting strange errors from Clang-Tidy. Fearing it was some weird interaction between my MSBuild config, .clang-tidy, the Unity build, or project structure, I tried a simple x64 console project right from the templates and managed to get the same error:
Command-line test case
Just create a new Console Application, Enable Code Analysis on build and Clang-Tidy, build in x64/Debug.
Expected behavior
No compile failures ([clang-diagnostic-error]) every time intrin.h is included.
STL version
Microsoft Visual Studio Community 2019 Preview Version 16.8.0 Preview 3.0
The text was updated successfully, but these errors were encountered: