How to unit test deliberate compilation errors of template code
Do it in the similar way compiler tests are written. You will have a bit of testing code in some scripting language (shell, perl, tcl etc.) that will run compiler on given snippets of code and check whether the right ones compiled and the right ones did not. gcc uses DejaGnu, which is built on … Read more