-
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
add support for [[msvc::intrinsic]] #3182
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, but it's failing format validation. You'll need to run the problem files through clang-format 15 either manually, or with the format
build target, or by downloading and applying the patch the build generates to check formatting (https://dev.azure.com/vclibs/STL/_build/results?buildId=12759&view=artifacts&pathAsName=false&type=publishedArtifacts).
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for making the STL go faster! Must go faster! 🏃 🚗 🦖 |
It is worth noting that @xiangfan-ms noted since these functions are not instantiated in some cases, it is possible that |
@cdacamar that implies a bug in one of the #include <utility>
int main() {
(void) std::forward<int&>(42);
} triggers the |
Did you also compile with
Which is correct if the function were replaced with a cast, but also does not instantiate the function so the static assertion is missing. |
Aha! No, I did not. Do I surmise correctly that the optimization is only enabled in strict mode? |
Yes, the optimization is only available when |
This adds support for the detection and application of the
[[msvc::intrinsic]]
attribute which will allow the compiler to internally implement some functionality of the STL without a function call.