-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
A result type of __builtin_choose_expr
that returns a pointer to a function is not correctly inferred in clang mode
#9368
Comments
_builtin_choose_expr
that returns a pointer to a function is not correctly inferred__builtin_choose_expr
that returns a pointer to a function is not correctly inferred
The bug doesn't repro when the missing |
Thank you for your reply. Sorry, I seem to have lost the underscore when taking the screenshot. The issue still reproduces even with The example project has no
Here is the output of C/C++: Log diagnostics
FYI: This is a screenshot of the issue with a working real-world application (Ruby) https://github.com/ruby/ruby/blob/936e54063d4de0e44925e9139cb4d25cce27c187/array.c#L8746-L8779
|
This is the "same" issue as #8294, which got fixed for gcc mode but not clang mode. |
Thank you! I confirmed the errors dissapper if I change the |
__builtin_choose_expr
that returns a pointer to a function is not correctly inferred__builtin_choose_expr
that returns a pointer to a function is not correctly inferred in clang mode
This is fixed in 1.13.4 (pre-release): https://github.com/microsoft/vscode-cpptools/releases/tag/v1.13.4, although there's a related issue at #10168 that won't be fixed till 1.14.0. |
Bug type: Language Service
Describe the bug
__builtin_choose_expr
returns a pointer to a function, the result type seems not to be inferred correctly.Steps to reproduce
expression preceding parentheses of apparent call must have (pointer-to-) function type
Expected behavior
No error is shown.
Code sample and logs
Screenshots
![image](https://user-images.githubusercontent.com/21557/170426166-03af76ed-e15f-4980-b303-63ae159155e1.png)
NOTE: Screenshot is incorrect and missing an `_`.Additional context
This idiom is heavily used in the source code of the programming language Ruby.
https://github.com/ruby/ruby/blob/2556e15d7520913119175c8166b1f9d17eb33415/include/ruby/internal/anyargs.h#L287
RBIMPL_ANYARGS_DISPATCH_rb_define_method((arity), (func))
returns a pointer to a function by using__builtin_choose_expr
, and then the function is invoked.The text was updated successfully, but these errors were encountered: