add support for [[msvc::intrinsic]]#3182
Conversation
There was a problem hiding this comment.
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.