Since you're already using emacs, I'm wondering if fitting one of the many open source linters onto it might be preferred over an IDE? That way's probably more flexible than an IDE, and you get to stay in your One True Editor.
For C++, there are these linters to choose from:
If you're not yet attached to your editor, Vim has Syntastic to integrate these so that your file is automatically checked as you type or when you save.
Several of these know how to generate emacs-ready output.
Unfortunately, on my system, neither gcc, clang_check, nor cpplint complained about your two testcases. Even with
g++ -ansi -pedantic -Wall -Wextra -Weffc++.
Of the list above, cppcheck might be the one most likely to catch your testcases, being a static analysis tool ("not a compiler" as they say in the docs).
In fact, it did catch your
$ cppcheck --enable=all test.cc
[test.cc:17] -> [test.cc:17]: (style) Same expression on both sides of '<'.
Maybe a C++ programmer can chime in here why returning something other than the declared bool in your testcase is not something tools crow loudly about.
Each linter/compiler listed above has a myriad of options - maybe their sensitivity can be cranked up to catch both of your cases.
I realize you asked for an IDE, but a good editor with plugins and a good setup is sometimes indistinguishable from an "IDE".