What is the function of the noun clause in this sentence?

The street musicians sang to whomever passed them.

Responses

appositive

appositive,

direct object

direct object,

subject

subject,

object of a preposition

The function of the noun clause in this sentence is the direct object.