fix Issue 11187 - A small transitive const bug on struct copying
Merge pull request #2639 from 9rnsr/fix11187

Issue 11187 - A small transitive const bug on struct copying