This is a non-functional change which acts as a precursor to the functional changes (fixes) in https://reviews.llvm.org/D146101, pulled out as requested by @MyDeveloperDay .
The changes:
- make the tests more concise
- fix invalid C++ in the code samples
- ensure line breaks in tests' code samples correspond to line breaks in the test code itself for the avoidance of confusion
The refactored version of these test cases has been moved up to immediately follow the setting of OuterScope so that the result can be compared with the identical code sample above which doesn't use OuterScope. It was odd that these weren't grouped together before.