Skip to content

Conversation

@StephanTLavavej
Copy link
Member

This ports @xiangfan-ms's MSVC-PR-360974, which was merged on 2021-10-29 but we forgot to mirror it.

Xiang optimized the MSVC compiler front-end to recognize type_identity_t and _Identity_t, which became heavily used after we merged #2032 implementing P1518R2 Stop Overconstraining Allocators In Container Deduction Guides.

As part of this work, our internal aliases _Identity_t and _Remove_cvref_t need to be marked with the attribute _MSVC_KNOWN_SEMANTICS:

STL/stl/inc/yvals_core.h

Lines 424 to 434 in 1801934

// Determine if we should use [[msvc::known_semantics]] to communicate to the compiler
// that certain type trait specializations have the standard-mandated semantics
#ifndef __has_cpp_attribute
#define _MSVC_KNOWN_SEMANTICS
#elif defined(__CUDACC__) // TRANSITION, CUDA - warning: attribute namespace "msvc" is unrecognized
#define _MSVC_KNOWN_SEMANTICS
#elif __has_cpp_attribute(msvc::known_semantics)
#define _MSVC_KNOWN_SEMANTICS [[msvc::known_semantics]]
#else
#define _MSVC_KNOWN_SEMANTICS
#endif

@StephanTLavavej StephanTLavavej added throughput Must compile faster compiler Compiler work involved labels Dec 10, 2021
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner December 10, 2021 03:41
@StephanTLavavej StephanTLavavej merged commit 5e3574b into microsoft:main Dec 10, 2021
@StephanTLavavej StephanTLavavej deleted the optimize_identity branch December 10, 2021 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler Compiler work involved throughput Must compile faster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants