Currently, rtags offers the best support for code navigation of a C++ project in Emacs. It uses clang as the back-end to parse the source code. Other tools such as ctags, gtags, csope, dumb jump, etc. relies on regexp matching using a tag file, that is fine for C projects but difficult to parse C++. Semantics parse the source code in elisp and thus might be too slow for large projects, and also fall behind the new C++ features. cquery is an emerging tool that seems promising, too.
It is said that irony offers better code completion than rtags.
Both rtags and irony-mode require a compilation database for clang. Some tools such as cmake or ninja can produce this, but not for other tools. We will use bear to intercept the output of scons and make a database, as suggested by the author here.
Since bear works by intercepting the exec emitted by the child process,
there is no need to add the --verbose flag, and it needs a full build from clean.
example for using a locally installed bear with scons:
~/bin/bear/bin/bear -l ~/bin/bear/libear/libear.so scons trg