-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
#pragma clang diagnostic ignored "-Wpadded"
leaves scope
#871
Comments
Can you also check with current Catch? I suspect it will still be there, but ... Also it might be intentional -- Catch generates some code in the test files, so we have to leak suppressions to the test file as well -- but in this case I don't think it is and will have to check. |
It still does.
|
@tomvierjahn That is not the current version. We probably should have deleted that branch when we went back to fixing Catch Classic, but it was left around in case we wanted to backport some changes. Using Catch v1.8.2 and compiling this file struct foobar {
bool b;
int i;
};
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
TEST_CASE("aa") {
REQUIRE(1 == 2);
}
void foo() {
foobar fb;
} Triggers
|
I think the problem is when the struct is defined after the catch header and not before, but the issue seems fixed - online compiler - triggers the warning as desired |
@onqtam My brief testing showed that Clang cares about instantiation of the structs, not definition, when issuing |
Unfortunately, it is not fixed yet. Setup
Case 1:
variant A
warning:
variant B
warning:
variant C
warning:
Case 2
variant A:
no warning variant B:
warning:
|
I finally got back to this and it should now be fixed in master (not in the single include yet). It turned out that this was by interplay between superfluous include, and our single header generator, making it so that a |
Description
I am using clang and
-Wpadded
.and clang complains about padding in class Foo, as desired.
Whereas
leads to no warnings.
It seems that some
#pragma clang diagnostic ignored "-Wpadded"
are not enclosed by push/pop in the single header version.Steps to reproduce
see above
Extra information
The text was updated successfully, but these errors were encountered: