Dear Thomas, I wrote this almost immediately after you posted the patch, got disturbed and forgot about it - my apologies. Note Dominique's reply after you corrected the PR number.
OK for trunk. The part in decl.c is exactly what I was thinking to do. Thanks for the patch Paul