Does "brew install gcc" installs GNU C++ compiler on macOS?
Yes, installing gcc using brew install gcc will install GNU C++ compiler.

The compiler is installed by default in /usr/local/Cellar/gcc/8.2.0/bin.