Downgrade GCC version
To install GCC 4.7 from Homebrew:

$ brew tap homebrew/homebrew-versions
$ brew install gcc47


which will install it as gcc-47. If you want to install as gcc instead:

$ ln -s /usr/local/bin/gcc-47 /usr/local/bin/gcc