Apple warranty info:
Strictly speaking they can't "void" the warranty just because you change/upgrade something yourself.
They can refuse to cover your new hard drive, or refuse to fix your DVD drive because you broke the connector when unplugging it. They can't refuse to fix a known-faulty GPU because you changed the hard drive several months previously.
Of course, it's highly recommended no to mention it at all though, because it's likely you'll get some chump whose job it is to try and find any reason to deny warranty claims. Even if they do ask just say you got it done at another AppleCentre.