I am having the same problem as this guy. Compiling with clang and ccache I get this warning everytime it encounters a Q_OBJECT:
warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign]
This only happens when using ccache, compiling the same code with clang alone works fine.
There seems to be a similar issue with macro expansions where the suggested solution is to set the environment variable
CCACHE_CPP2=yes
Unfortunately, this does not seems to fix my issue, or maybe I'm doing it wrong.
I have tried:
Building from command line with
CCACHE_CPP2=yes ninja
export CCACHE_CPP2=yes ninja
Building from Qt Creator, adding
CCACHE_CPP2
to "Build Environment"
Is there anything else I can do to fix this macro expansion issue? I specifically do not want to disable warnings globally (because that's bad) or locally (because that means wrapping all macros in compiler-specific boilerplate).