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

Remove the STATIC_ASSERT macro from tests where it is unnecessary #4588

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented Apr 14, 2024

For tests only for C++17/20/23, static_assert(expr) can be directly used, and thus it's possibly better to drop STATIC_ASSERT (which possibly slows down the preprocessor).

Also remove STATIC_ASSERT from tests where it's unused.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner April 14, 2024 14:32
@StephanTLavavej StephanTLavavej added the test Related to test code label Apr 14, 2024
@StephanTLavavej StephanTLavavej self-assigned this Apr 14, 2024
@StephanTLavavej
Copy link
Member

Thanks! Verified that there are no stray changes here by replicating the result of the search-and-replace and diffing them.

It's very rare that static_asserts in tests fail, and if they do, the first thing I do is check the source code, so the fact that MSVC doesn't emit a very detailed diagnostic by default (without /diagnostics:caret, which we stopped bothering with in the test harness) has never annoyed me.

@StephanTLavavej
Copy link
Member

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

@StephanTLavavej StephanTLavavej merged commit a58d716 into microsoft:main Apr 19, 2024
35 checks passed
@StephanTLavavej
Copy link
Member

Thanks for this significant demacroization! 🧹 🪄 😺

@frederick-vs-ja frederick-vs-ja deleted the static_assert-tests branch April 19, 2024 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Related to test code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants