its been used by others for years and it worked perfectly AFAIK with gcc and clang before I started using qtcreator which complained.
Here's my guess: Previously, the assert() macro was disabled. This caused the illegal code to be effectively "commented out", so the compiler didn't detect it. After the migration, the assert() macro was no longer disabled, so the compiler now sees the bad code and (correctly) complains.
See http://www.cplusplus.com/reference/cassert/assert/. You could make your code work again by defining the NDEBUG macro, but be careful: This will disable all assert()s which might cause other errors to go undetected.
P.S. The compiler is the one that complained, not Qt Creator.