Skip to content

Tests for P1831 and workaround for DevCom-10948908 - #5670

Closed
Yexuan Xiao (YexuanXiao) wants to merge 3 commits into
microsoft:mainfrom
YexuanXiao:volatile-traits
Closed

Tests for P1831 and workaround for DevCom-10948908#5670
Yexuan Xiao (YexuanXiao) wants to merge 3 commits into
microsoft:mainfrom
YexuanXiao:volatile-traits

Conversation

@YexuanXiao

Copy link
Copy Markdown
Contributor

Even with /W3, MSVC doesn't respect the [[deprecated]] attribute of template specializations (DevCom-10948908).
Therefore, the macro _CXX20_DEPRECATE_VOLATILE has no effect with tuple_size, tuple_elements, variant_size and variant_alternatives.

Due to another bug of MSVC, applying the [[deprecated]] attribute directly to type still has no effect, so it can only be applied to _Mybase. Since my attempt to reproduce it failed, I cannot report it as another bug. When DevCom-10948908 is fixed, this bug may still persist, but all two workaround can be removed.

@YexuanXiao

This comment has been minimized.

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) moved this from Initial Review to Work In Progress in STL Code Reviews Aug 8, 2025
@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) added the enhancement Something can be improved label Aug 8, 2025
@YexuanXiao

Copy link
Copy Markdown
Contributor Author

This issue also exists in Clang19 and Clang20, but it will be fixed in Clang21. See commit.

@YexuanXiao

Copy link
Copy Markdown
Contributor Author

Stephan T. Lavavej (@StephanTLavavej) What is the difference between checks numbered 3, 4, and others in Build and Test x64 x64? They unexpectedly passed some new tests.

@MattStephanson

Matt Stephanson (MattStephanson) commented Aug 10, 2025

Copy link
Copy Markdown
Contributor

What is the difference between checks numbered 3, 4, and others in Build and Test x64 x64? They unexpectedly passed some new tests.

#1414 originally introduced this feature, but #2794 concisely explains it:

We use LLVM lit's "sharding" feature to split our large test suite across 8 VMs per architecture

If you go to the pipeline run webpage and click on the results tab, you'll see a list of the failed tests.

@YexuanXiao

Copy link
Copy Markdown
Contributor Author

What is the difference between checks numbered 3, 4, and others in Build and Test x64 x64? They unexpectedly passed some new tests.

#1414 originally introduced this feature, but #2794 concisely explains it:

We use LLVM lit's "sharding" feature to split our large test suite across 8 VMs per architecture

If you go to the pipeline run webpage and click on the results tab, you'll see a list of the failed tests.

Based on your explanation, I believe I have found a clue to reproduce the issue. Thanks!

@YexuanXiao

Copy link
Copy Markdown
Contributor Author

The workaround for tuple_element and variant_alternative does not work for Clang 19, even when applying the [[deprecated]] attribute directly to type instead of _Mybase. It's as tricky to simplify to reproduce as the MSVC bug. I can't figure out how to implement a workaround for it.

@YexuanXiao

Copy link
Copy Markdown
Contributor Author

The MSVC team believes a CWG issue is needed, so it may not be fixed in the short term. How should STL adapt to this situation? Stephan T. Lavavej (@StephanTLavavej)

@StephanTLavavej

Copy link
Copy Markdown
Member

Yexuan Xiao (@YexuanXiao) Thanks for looking into this. Because MSVC's behavior is unlikely to change in the moderate future and the impact of missing deprecation warnings for volatile machinery is highly limited, I believe I would prefer to abandon this attempt. I appreciate the effort you've put into it, but at this point I don't think making changes here is worth the complexity, risk, and time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Something can be improved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants