Token pasted by the preprocessor (through ##) have a Spelling pointing to scratch buffer. As a result they are not recognized at system macro, even though the pasting happened in a system macro. Fix that by looking into the parent macro if the original lookup is not enough.
This effectively fixes https://bugs.llvm.org/show_bug.cgi?id=35268, but I'm not quite sure about the kind of test case I should add with this patch?
I think this also matches things like:
... where the location of x token produced by the BAR macro will now be considered to be in a system macro. Can you make this more targeted? (Maybe we could change the SLocEntry for the token-paste scratch buffer to be considered a system header if the ## token is in a system macro -- that'll need the preprocessor to store two ScratchBuffers, one for system headers and one for user code, but that seems acceptable.)