Also running into this same error and my rstan program no longer compiling.
OS: Windows 10
Makevars.win is empty
Makevars contains CXX14 = C:/rtools40/mingw64/bin/g++
Had posted about windows 10 and R4.0 troubles earlier noticing issues after upgrade to R4.0. See this post.
.