...
#-----------------------------------------
# to enable newer gcc from software collections:
# (replace devtoolset-46 with current version of devtoolset)
#-----------------------------------------
if [ -x /opt/rh/devtoolset-46/enable ]; then
echo Enabling GCC from Developer Toolset
source /opt/rh/devtoolset-46/enable
fi
To use the newer versions on the command line after the RPMs are installed :(this example is from devtoolset-4, but the same idea works for devtoolset-6)
user@host $ scl enable devtoolset-4 bash
bash-4.1$ gcc --version
gcc (GCC) 5.2.1 20150902 (Red Hat 5.2.1-2)
bash-4.1$ exitksa@iris02 $ scl enable devtoolset-4 'gcc --version'
gcc (GCC) 5.2.1 20150902 (Red Hat 5.2.1-2)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
...