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