clang-format: Align asterisk (*) of pointer declaration with variable name

PointerAlignment: Right is unfortunately not implemented yet. See https://github.com/llvm/llvm-project/blob/master/clang/lib/Format/WhitespaceManager.cpp#L643 void WhitespaceManager::alignConsecutiveDeclarations() { if (!Style.AlignConsecutiveDeclarations) return; // FIXME: Currently we don’t handle properly the PointerAlignment: Right // The * and & are not aligned and are left dangling. Something has to be done // about it, but it raises the question of alignment of code like: … Read more

Install libc++ on ubuntu

How to build libc++ on Ubuntu 16.04 I had a similar issue as you do. While testing clang with libstdc++ worked fine with C++11 and C++14 there still might be licensing issues with libstdc++. So I ended up installing Clang toolchain from their repos and compiling libc++ on Ubuntu 16.04. Disclaimer: This post is summary … Read more

Complete list of Clang flags

I don’t know if this is exactly what you want. Maybe more options are described elsewhere, but I think you are interested in the Clang frontend options. By default, the options displayed seem to describe the “GCC-compatible driver”. clang -cc1 –help should give you what you want.

Clang optimization levels

I found this related question. To sum it up, to find out about compiler optimization passes: llvm-as < /dev/null | opt -O3 -disable-output -debug-pass=Arguments As pointed out in Geoff Nixon‘s answer (+1), clang additionally runs some higher level optimizations, which we can retrieve with: echo ‘int;’ | clang -xc -O3 – -o /dev/null -\#\#\# Documentation … Read more