<div dir="ltr"><div>Hi, </div><div><br></div><div>hopefully a straightforward issue. </div><div><br></div><div>I have written a standalone cfe tool to catch some project-specific bugs in a code base.</div><div><br></div><div>I am now replacing my cout << "ERROR..." messages with clang::Diagnostics by following this example:</div><div><br></div><a href="https://github.com/peter-can-talk/cppnow-2017/blob/master/code/mccabe/mccabe.cpp#L46-L54">https://github.com/peter-can-talk/cppnow-2017/blob/master/code/mccabe/mccabe.cpp#L46-L54</a><br><div><br></div><div>However I don't see anything being printed when I run it (except my own cout << "error.." messages)..</div><div><br></div><div>I've seen the mcabbe example generate diagnostics on a youtube presentation and both it and my app use clang::Tool.  mccabbe uses ast_matcher::MatchFinder whereas I use several classes derived from RecursiveASTVisitor. Presumably MatchFinder sets up a DiagnosticsConsumer that finally emits the diagnostics??</div><div><br></div><div>But I couldn't really find out how to set up a DiagnosticsConsumer - if that is indeed what I need to do.</div><div><br></div><div>Thanks,</div><div>Billy.</div></div>