I was in the same situation with one of my clients. Since this was during the server set-up, we opted for the "play-it-safe" solution:
- compile a new compiler
- compile R with the new compiler
- compile some external libraries with the new compiler (e.g. QuantLib and poppler)
- install required R packages system wide using the new compiler
For an in-use system, the next step would be re-installation of all (compiled) packages in the user libraries.
I am not sure if one has to use this "play-it-safe" approach. I do not expect any immediate breakages after updating the compiler. However, some strange problems might come down the road, e.g.:
- You have
poppler installed (either from EPEL or compiled with the old compiler) and users have installed pdftools.
- You upgrade the compiler.
- A new user tries to install
pdftools or an existing user tries to update it.
From my experience this last step will fail. And since this might be long after the compiler upgrade, it can be difficult to come to the right solution, i.e. compile poppler with the new compiler.
BTW, at that time we also considered a workaround: Configure CXX14STD to use -std=gnu++1y, which would give partial C++14 support. IIRC it was possible to install rstan that way, but it was deemed as not safe enough in the long run.