fix mismatch of the scope push/pop paring
[Refactoring] Replace new Scope(*sc) to sc->copy()
fix Issue 11777 - [ICE] dmd memory corruption as `Scope::pop` `free`s `fieldinit` used also in `enclosing`
Merge pull request #3423 from 9rnsr/fix11777

[REG2.065] Issue 11777 - [ICE] dmd memory corruption as `Scope::pop` `free`s `fieldinit` used also in `enclosing`
fix Issue 12523 - wrong type deduced for foreach ref argument

- No need to change the storage class because the var type
  already has inferred modifiers.
Merge pull request #3424 from MartinNowak/fix12523

fix Issue 12523 - wrong type deduced for foreach ref argument
[style] fix indent
[Refactoring] Change return types from int to bool
[Refactoring] Remove side-effect in searchCtor
[Refactoring] Rename scope variable to `sc2` for aggregate members
[Refactoring] Use semanticRun for aggregates

Reasons:
1. Currently used states have problems:
  - `members` and `symtab` would be NULL for opaque declaration
  - `sizeok` is not set for InterfaceDeclaration
2. We should catch the "the first called semantic" timing for some reasons
[Refactoring] Consolidate forward reference handling between aggregates

- Find valid `scope` first
- Set parent before `type` semantic and its mangling calculation
- `parent` and `type` are necessary even for opaque declaration
[Refactoring] Consolidate handling of protection, storage_class, and userAttributes

They should be applied even for opaque declaration
[Refactorign] Consolidate `symtab`
Separate class hierarchy calculation from class member semantics
fix Issue 12078 - forward reference issue with is() and curiously recurring template pattern
fix Issue 12143 - Base class is forward referenced