fix Issue 10768 - DMD does not show deprecation message for missing 'override' keyword

If a class/struct/template is not speculatively instantiated, error gagging should be ungagged temporarily during its semantic.
Use RAII idiom to do it reliably.
Improve bug4269 test cases
Merge pull request #2453 from 9rnsr/fix10768

Issue 10768 - DMD does not show deprecation message for missing 'override' keyword