[PATCH] D123134: [demangler] No need to space adjacent template closings

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 17:29:54 PDT 2022


rjmccall added a comment.

I think you're right that I signed off on it; I don't remember when or where that was, or what I said about it then, but regardless I can tell you that there are two basic reasons:

- First, the result of demangling to a string is not source code. It produces valid source code as much as it can, and that's a good choice, but there are common cases where it cannot just produce source, and there is no use case that requires it to produce source.  Ultimately, this is just a string that is going to be presented to a human.
- Since we're just going to present it to a human, what mainly matters is what the human's expectations are.  Approximately no C++ programmers will be confused to see >> terminating a template argument list, in part because it's been a long since since C++11 was available, but also simply because it was unnatural for programmers to remember to include the space in the first place, to the point that any reasonable compiler had to catch it and recover as a common error.

If you want to put that in the commit, feel free.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123134/new/

https://reviews.llvm.org/D123134



More information about the llvm-commits mailing list