Make declaration compatible

Fixes #12236 

@butonic