Include test to verify patch that removes 'using namespace std' from headers
Closed this issue · 1 comments
A patch was generated (#143) to remove the using namespace std
from the sleigh headers due to issues with compilation on Windows (#139).
This repo should include a test that will detect (in some way) whether the rebased patch continues to work.
Compiling the project and running the tests is a good indication that the patch continues to work, but if a new header file is added and includes a using namespace std;
that we forget to remove, then we could have regressions.
It's a bit unclear to me what the test would look like, but maybe somebody has a better idea.
Perhaps something like this could work?
struct vector {};
struct set {};
struct unordered_map {};
struct string {};
// not sure if there are any other public headers?
#include <sleigh/libsleigh.h>
int main() {
vector v;
set s;
unordered_map m;
string str;
}
For MSVC it should use use target_compile_features(test PRIVATE cxx_std_20)
because there were some weird issue with /permissive-
and std::byte
colliding deeply in the sleigh headers.