Link gcc using Homebrew on Mojave operating system
The owner of the /usr/local/include/c++ seems to be changed, which indicates you may used sudo with command brew. Never use sudo brew.

Firstly, fix the ownership recursively.

sudo chown -R "$USER":admin /usr/local/*


Secondly, relink the package gcc.

brew unlink gcc
brew link --overwrite gcc


References


How to fix homebrew permissions?