When a pioneer merges into an army stack, when a city is built later by that pioneer the city is built at the location where the pioneer merged.
Steps to reproduce.
Build pioneer
Find a valid build location
Move pioneer off that swuare
Move another unit, leader or soverign to the build location
Merge pioneer onto unit,leader or soverign
Move away
Select pioneer in stack issuer build command
City is built wher pioneer merged with other unit,leader or soverign.