Skip to content
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

Various cleanups: product code #4444

Merged

Conversation

StephanTLavavej
Copy link
Member

  • In _Popcount_fallback(), after if constexpr ... return add else to avoid dead code.
    • We always follow this convention for if constexpr.
  • Remove unnecessary _STD qualification on types, variable templates, and alias templates.
  • yvals_core.h: Improve "error STL1003: Unexpected compiler, expected C++ compiler." like use only static_assert for _EMIT_STL_ERROR #4020.
    • Then we can move _STL_STRINGIZE down to its point of use, near our other macros.
    • Result:
      D:\GitHub\STL\out\x64>type woof.c
      #include <vector>
      
      D:\GitHub\STL\out\x64>cl /EHsc /nologo /W4 /c woof.c
      woof.c
      D:\GitHub\STL\out\x64\out\inc\yvals_core.h(23): fatal error C1189: #error:  error STL1003: Unexpected compiler, expected C++ compiler.
      

… and alias templates.

This became possible after my GH 4146 moved these functions into `namespace std`.
…++ compiler." like GH 4020.

Then we can move `_STL_STRINGIZE` down to its point of use, near our other macros.

```
    D:\GitHub\STL\out\x64>type woof.c
    #include <vector>

    D:\GitHub\STL\out\x64>cl /EHsc /nologo /W4 /c woof.c
    woof.c
    D:\GitHub\STL\out\x64\out\inc\yvals_core.h(23): fatal error C1189: #error:  error STL1003: Unexpected compiler, expected C++ compiler.
```
@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Mar 4, 2024
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner March 4, 2024 02:12
@StephanTLavavej StephanTLavavej self-assigned this Mar 6, 2024
@StephanTLavavej
Copy link
Member Author

I'm speculatively mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit b46e2a6 into microsoft:main Mar 8, 2024
37 checks passed
@StephanTLavavej StephanTLavavej deleted the cleanups-6-product-code branch March 8, 2024 05:25
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
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant