Our Parsha begins with a list of the names of Yaakov's sons who came to Mitzrayim (שמות א:א-ד'). Later, we read about how Moshe's name was given to him (שם ב:י'), and then about the naming of Moshe's first son (שם פסוק כ"ב). The Midrash in Shemos Rabbah (פרשה א' סימן ל"ג) notes that names were often given to correspond to a particular event. Today, it is customary in Ashkenazic communities to name a child after a deceased relative, as mentioned by the Sdei Chemed (אסיפת דינים, מערכת חתן וכלה וחופה אות ה'), among others. Is it permissible, however, to name a child after a grandparent or parent who is still alive? In the Sefer Chassidim (סימן ת"ס), Rabbeinu Yehudah HaChassid states that while non-Jews give their sons the same name as the child's father, Jews do not do this, and there are indeed places where Jews do not name a child after anyone living, but rather only after people who have died. Apparently, it is only a Minhag to avoid naming children after people who are yet alive. As pointed out by the Sdei Chemed (שם), Sephardic Jewry has never accepted this practice and customarily a child will indeed be named after his living grandparent. Does an Ashkenazic Jew enjoy this liberty as well?
There are several possible sources which mandate loyalty to a Minhag. One is based on the Posuk in Mishlei (א:ח) which says "שמע בני מוסר אביך ואל תטוש תורת אמך," listen my son to the instruction of your father, and do not abandon the teaching of your mother. The Gemara in Pesachim (דף נ:) understands that this Posuk comes to require a person to maintain the Minhagim of his family. Another source is based on a Gemara in Nedarim (דף ט"ו.) which suggests that if one customarily treats something as prohibited even though it is permissible, it is considered as if he has taken a נדר, a vow to treat this as prohibited, and he therefore cannot then treat it as permissible. This ruling is recorded in the Shulchan Aruch (יורה דעה סימן רי"ד סעיף א'). This idea is similar to that which is recorded by the Rif in Berachos (דף י"ט. בדפיו) who rules that although Davening Maariv is in fact optional, not obligatory, once one has accepted it upon himself, it is as though he has taken a נדר to do it and it becomes obligatory. This is the basis for the Halacha requiring תפילת ערבית, Maariv, today, despite the fact that fundamentally, תפילת ערבית רשות, Maariv is optional. It would thus appear in our case as well, an Ashkenazic Jew would be bound to follow the custom to avoid naming his child after a living relative for the above reasons.
The Chavos Yair, however (שו"ת חות יאיר סימן קכ"ח), claims that the above cited Posuk from Mishlei is only an אסמכתא, a hint, and not really the source of a definitive obligation. He adds that a Minhag is binding only when accepted by a Kehillah in a particular community. If, however, the community has dispersed and no longer functions as a community, there exists no obligation upon any individual member to retain the Minhagim of that previous community. If so, then perhaps this Minhag to avoid naming children after living relatives is no longer binding because those Ashkenazic communities which accepted it no longer exist. Moreover, in Tosafos in Pesachim (דף נ"א. בד"ה אי), an opinion is cited which distinguishes between a "מנהג חשוב," an important Minhag, which was introduced by Talmidei Chachomim, and a "מנהג שאינו חשוב," which was introduced by the lay community on its own. The Ri, who is the author of this opinion, is in doubt as to whether or not a Rav could allow his Talmidim to ignore a Minhag of the second category. The Minhag to avoid naming children after living relatives is indeed in this second category; there may then be some room for leniency. It would appear from the Rif in Pesachim (דף י"ז. בדפיו) that the Ri's reluctance to allow a Rav to do away with the second type of Minhag is due to the fact that leniency in this area might lead members of the lay community to be lenient in similar situations which in fact involve actual prohibitions; the Rosh (שם פרק ד' סימן ג') adds that people may be led to violate laws from the Torah. This Minhag about names, however, does not involve any potential prohibition or violation at all, and its abandonment would not lead to any such prohibition; it would thus appear that one need not be strict about this Minhag.
There exists much evidence that in the past, Gedolei Yisrael did indeed name children after parents or grandparents who were still alive, and hence our Minhag not to do so is at best a מנהג שאינו חשוב, an unimportant Minhag. Rashi, in his commentary to Divrei HaYamim Aleph (ב:נ) writes that Chur named his son Kaleiv after his own still living father Kaleiv. In the Gemara in Chulin (דף מ"ז:), we find that certain children were named after Rabbi Nosson HaBavli while he was still alive. Rabbi Reuven Margoliyos, in his commentary called Mekor Chessed on the Sefer Chassidim (שם), cites many other relevant examples. He records that when a child was born to the son of the Ramban, the Ramban wanted the child to be called Moshe after him (although he was obviously still alive), but ultimately asked that the child be named for his other grandfather, Rabbeinu Yonah, who had already died. It is clear, though, that there was no hesitation to give the child the name of a relative who was still alive.
The Darkei Teshuvah (סימן א') refers to the Gemara in Kiddushin (דף ל"א:) as a possible source for this Minhag to avoid naming a child after a living relative, or at least, to avoid naming a child after a living grandparent. The Gemara implies that part of the definition of the Mitzvah of showing honor to a parent is the idea that a child should never mention the name of his father or mother. This ruling is recorded in the Shulchan Aruch (יו"ד סימן ר"מ סעיף ב'). If an adult names his child after his own parent, therefore, every time he will subsequently mention the child's name he will also be mentioning his parent's name. This, then, may be the origin of this Minhag. He adds, however, that since this restriction is predicated upon the fact that one must honor his parent, if the parent agrees to forego this honor, there would be no problem, because a parent may waive the honor that is due him, as is documented in the Shulchan Aruch (שם סעיף י"ט). It appears, then, that although the Ashkenazic practice is still to avoid naming a child after a living relative, if for some reason, a grandparent makes a request to have a grandchild named after him during his lifetime, in which case he obviously is not concerned that his name will be regularly used by his child, it would be permissible. It is worth noting that Rav Moshe Feinstein (שו"ת אגרות משה או"ח חלק ד' סימן ס"ז) states that it is appropriate to name a child after a Tzaddik in one's generation who is still alive.