I have a script that builds llvm/clang 3.42 from source (with configure+make). It runs smooth on ubuntu 14.04.5 LTS. When I upgraded to ubuntu 17.04
I faced the same problem on my Ubuntu 16.10. It has default gcc 6.2. You need to instruct LLVM build system to use gcc 4.9. Also, I suggest you remove GCC6 completely.
$ sudo apt-get remove g++-6 gcc-6 cpp
$ sudo apt-get install gcc-4.9 g++4.9
$ export CC=/usr/bin/gcc-4.9
$ export CXX=/usr/bin/g++-4.9
$ export CPP=/usr/bin/cpp-4.9
$ ./configure
$ make
And maybe you will need:
$ sudo ln -s /usr/bin/cpp-4.9 /usr/bin/cpp