Before this patch, it was possible to access non-static class members using static access, which resulted in C++ compilation errors. This adds verilation-time checks for such situations.