In the space of two days, I found two very good philosophers, Thomas Nagel and A. John Simmons, using the expression "duty of charity." That is an oxymoron. There can be a duty of beneficence,but not a duty of charity, for charity is a motive (or, in popular usage, an act conjoined with a motive, namely, love). If it's a duty, it's not charity; if it's charity, it's not a duty. "Charity" derives from "caritas," which is Latin for love. Another dismaying expression, found in Nagel, is "enforced charity." If the state taxes me for the benefit of others, it is not charity on my part. It is coercion. It may be justified coercion, but it's still coercion. If it's forced, it's not charity; if it's charity, it's not forced.
I think the source of these confusions is conflation of benevolence and beneficence. The former describes a motive, the latter an act. Benevolent people are motivated to do good. Beneficence is the act of doing good. More often than not, benevolent people perform beneficent acts; but not always. Benevolent people can, and sometimes do, perform maleficent acts, just as malevolent people can, and sometimes do, perform beneficent acts. Charity, being motivated by love, is necessarily benevolent. Beneficence, which can be motivated by malevolence, is not necessarily charitable. Beneficence, which is an act, can be forced and can be required by duty. Benevolence, which is a motive, cannot be forced and cannot be required by duty.
Instead of using the expression "duty of charity," Nagel and Simmons should have used "duty of beneficence." That just means a duty to benefit others (as opposed, say, to a duty not to harm others). Nagel should have used "enforced beneficence" instead of "enforced charity," for while people can be forced to do good, coerced into doing good, or manipulated into doing good, they cannot be forced to be well motivated, coerced into being well motivated, or manipulated into being well motivated. Charity has a particular motive—love or benevolence—built into it; beneficence does not.