fix Issue 12501 - Assertion `global.gaggedErrors || global.errors' failed.
Merge pull request #3414 from 9rnsr/fix12501

[REG2.066a] Issue 12501 - Assertion `global.gaggedErrors || global.errors' failed.
Supply scope for addMember call
[Refactoring] AttribDeclaration::createNewScope
[Refactoring] AttribDeclaration::newScope
Generalize addMember and importAll for derived class of AttribDeclaration
Generalize semantic2 and semantic 3
Always delay static-if condition evaluation