A tax would not impose a welfare cost only if the quantity exchanged did not change as a result—only when supply was perfectly inelastic or in the nonexistent case where the demand curve was perfectly inelastic. In all other cases, a tax would create a welfare cost by eliminating some mutually beneficial trades (and the wealth they would have created) that would otherwise have taken place.