Fix Issue 12705 and Fixup Pull 3501 - Default trust implies @system, and typeof(func) should
extract proper function attributes.
Merge pull request #3533 from AndrejMitrovic/FixupAttribs

Fix Issue 12705 and Fixup Pull 3501 - Fix @system and missing attributes when typeof(func) is used