The actual error will have occurred earlier.
You could try
my checkpkg script to get some more insight into the failure of this build.
Code:
sh checkpkg -l build.txt
If I would guess: the akonadi package may be causing this.
One of the akonadi header files contains a hardcoded compiler version. Check the file
Code:
/usr/include/KF5/AkonadiCore/std_exception.h
and make sure that the version number in
Code:
#include "/usr/include/c++/5.4.0/exception"
matches the version of the compiler you are using. Slackware-current comes with gcc-5.4.0 by default but perhaps you are using gcc-6.2.0 from the /testing directory.