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

Build assertion against conditions which cannot be evaluated. #106

Open
PengZheng opened this issue May 25, 2023 · 0 comments
Open

Build assertion against conditions which cannot be evaluated. #106

PengZheng opened this issue May 25, 2023 · 0 comments

Comments

@PengZheng
Copy link

According to the documentation:

Your compile will fail if the condition isn't true, or can't be evaluated by the compiler.

I find no tests for the latter case, so write one myself:

    int val = 0;
    BUILD_ASSERT(val != 0);
    BUILD_ASSERT(val == 0);

It compiles without any complaining.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant