Quote from the libstdc++-v3-documentation:

<<<<<<<<<<

The source code of libstdc++-v3 is distributed under version 2 of the 
GNU General Public License, with the so-called "runtime exception," 
as follows (or see any header or implementation file): 

   As a special exception, you may use this file as part of a free software
   library without restriction.  Specifically, if other files instantiate
   templates or use macros or inline functions from this file, or you compile
   this file and link it with other files to produce an executable, this
   file does not by itself cause the resulting executable to be covered by
   the GNU General Public License.  This exception does not however
   invalidate any other reasons why the executable file might be covered by
   the GNU General Public License.

<<<<<<<<<<<

The auxiliary-library libgcc is covered under the GPL(v2) with a similar 
"runtime exception".

Quote from libgcc2.h (gcc-4.0.4):

<<<<<<<<<<<

   As a special exception, if you link this library with other files,
   some of which are compiled with GCC, to produce an executable,
   this library does not by itself cause the resulting executable
   to be covered by the GNU General Public License.
   This exception does not however invalidate any other reasons why
   the executable file might be covered by the GNU General Public License.

<<<<<<<<<<<