ppa:ubuntu-toolchain-r/test is the wrong PPA unless your aim is to test new, experimental packages that might be vastly unstable. Furthermore, since that PPA is just a sandbox for testing, there's no particular package that's ever necessarily in there. Packages come and go.
- At the time of this posting, the only package that PPA provides for Oneiric (11.10) is
If you want to install PPA-provided toolchain builds, for any purpose except testing new toolchain-r packages, the "toolchain-r" team provides this repository:
However, that does not provide gcc-4.7 on Oneiric. It provides it for Quantal, but not Oneiric.
Searching for another PPA on Launchpad didn't reveal anything for me. You might be able to install a package intended for another release (or for Debian), but especially with a compiler suite, this runs the risk of not working...or not working entirely, such that you might not discover the problem until much later.
Installing the Upstream Version
Your best bet might be to install an upstream GCC 4.7. You can download and install it from any GCC mirror. For example, you can get GCC 4.7.2 here.
Bootstrapping/building GCC from upstream sources is somewhat time consuming and slightly more involved than building most software from source, but it's not too difficult. Check out the documentation that comes in the source archive. Most problems have solutions and you can search for them. Feel free to post questions here if you have trouble!
Alternatively, you may wish to create a full directory structure for a minimal Ubuntu system of a later version that has GCC 5.7, like 12.10 Quantal.
debootstrap facilitates this. Check out this guide for
debootstrap in Ubuntu. See also this question (applies to later versions of Ubuntu as well as earlier versions).