remove duplicate code
extend C++ tests to make sure we do not generate warnings (and fix some warnings that we did generate)
cannot currently enable warning checks for C++ class definition syntax as there are incorrect warnings