What is the opinion of the LDS Church in regards to unbaptized people's taking communion? In 2011, I visited a LDS church. On my visit, I noticed that bread and water were served. At the time, I merely thought they were some sort of snack for the congregation, and I gladly took a tiny cup of water and a piece of bread. The people didn't seem to care about my taking communion. Does that mean it is okay?
The breaking, blessing, and partaking of the bread and water constitutes the sacrament ordinance in the LDS Church. It's how one renews their baptismal covenants. If one has not made those covenants, it is of no matter. (Parents often encourage their children to take the sacrament to prepare them to one day renew their covenants and to teach them the value of the ordinance. Others discourage it because it has special meaning.)

Either way, the sacrament is not withheld from individuals while being passed, whether they are visitors or not. It is perfectly acceptable for visitors in an LDS congregation to partake of the sacrament:


  Although the sacrament is for Church members, the bishopric should not announce that it will be passed to members only, and nothing should be done to prevent nonmembers from partaking of it.


(from Handbook 2: Administering the Church, 20.4.1)