From Sahih Muslim (Hadith 2228):
Mas'ud b. al-Hakam al-Ansari informed Nafi' that he had heard Hadrat 'Ali (may Allah be pleased with him), son of Abu Talib, say about the biers:Verily, the Prophet (ﷺ) used to stand first but later on kept sitting; but it is also narrated that Nafi' ibn Jubair saw Waqid b. 'Amr standing for a bier till it was placed down
Reference: Muslim 2228