Will an inspector warn his/her client about a gas water heater in a bathroom closet?
M2005.2 Prohibited locations.
Fuel-fired water heaters shall not be installed in a room used as a storage closet.
Water heaters located in a bedroom or bathroom shall be installed in a sealed enclosure so that combustion air will not be taken from the living space.
Installation of direct-vent water heaters within an enclosure is not required.
Depends on the inspector you hired
Inspectors tend to focus on those things that are unsafe or unsound. If an inspector sees an water heater installation that is unsafe, he/she should report it. If it complies with accepted standards (i.e. is installed in accordance with manufacturer’s recommendations), they may decide that reporting it is not necessary. Some inspectors will go beyond accepted standards and cite code, but risk citing a violation of code that a particular municipality might not adhere to.
Some will report such an installation out of an abundance of caution even if everything appears to be in order. Others may not.