Quuxplusone added inline comments.

================
Comment at: clang/unittests/Format/FormatTest.cpp:13815
+  verifyFormat("co_yield++ i;");
+  verifyFormat("co_yield ++i;", Cpp20);
+
----------------
modocache wrote:
> Quuxplusone wrote:
> > If you're going to test C++11's behavior here, please use `co_yield - 1;` 
> > or something else that might reasonably appear in a C++11 program. 
> > `co_yield++ i;` is not valid C++ (unless `i` is a macro, I guess).
> `i` would be an iterator in this case.
No matter what `i` is, `co_yield++ i;` is never a valid sequence of tokens in 
C++17 (unless `i` is a macro, I guess).

`co_yield ++i;` will become valid in C++2a, but if you see that sequence of 
tokens in any C++ program ever, you can just assume that it is C++2a. There is 
never any reason to think that it should be formatted as `co_yield++ i;`, 
because that would not be valid C++17.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65043



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to