Expected build-failure tests in CMake
Sometimes it's good to check that certain things fail to build, e.g.: // Next line should fail to compile: can't convert const iterator to iterator. my_new_container_type::iterator it = my_new_container_type::const_iterator(); Is it possible to incorporate these types of things into CMake/CTest? I'm looking for something like this in CMakeLists.txt : add_build_failure_executable( test_iterator_conversion_build_failure iterator_conversion_build_failure.cpp) add_build_failure_test( test_iterator_conversion_build_failure test_iterator_conversion_build_failure) (Of course, these specific CMake