Imam Ibn Hazm Al Andalusi (ancient spain) رحمہ اللہ mentioned the statements of Tabain (Students of the Sahaba) with sahih asaneed and said:
It is proven from Imam Ibrahim Nakhi رحمہ اللہ that he said:
لم يكونوا يحجبون الصلاة عن أحد من أهل القبلة
Salaf never leave out the funeral prayer of anyone who prays in the direction of Kaaba (Ahle Qibla)
Imam Qatadah رحمہ اللہ said:
ما أعلم أحدا من أهل العلم اجتنب الصلاة على من قال: لا إله إلا الله
I don't know anyone from the the people of the knowledge that they refrained themselves to pray the funeral prayer of any person who testify لا اله الا الله.
Imam Ibn Sireen رحمہ اللہ said:
ما أدركت أحدا يتأثم من الصلاة على أحد من أهل القبلة.
I haven't seen any scholar who refrained to pray funeral prayer on any muslim by considering it as a sin.
Imam Hasan Al Basari رحمہ اللہ said:
يصلى على من قال لا إله الا الله وصلى إلى القبلة، إنما هي شفاعة.
The funeral prayer will be performed upon any one who recited الہ الا اللہ and prayed in the direction of the Kaaba and this is intermediary to Allah Azzawajal.
[Al Muhalla 5/171]