[PATCH] D65043: [Format] Add C++20 standard to style options

Brian Gesiak via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 8 09:04:42 PDT 2019


modocache added inline comments.


================
Comment at: clang/unittests/Format/FormatTest.cpp:13780
+  // In C++2a, it is interpreted as a prefix increment on 'i'.
+  verifyFormat("co_yield++ i;");
+  verifyFormat("co_yield ++i;", Cpp2a);
----------------
Quuxplusone wrote:
> My comment https://reviews.llvm.org/D65043#inline-582865 still stands. Please just write
> 
>     verifyFormat("f(co_yield - 1);");
>     verifyFormat("f(co_yield -1);", Cpp2a);
> 
Unfortunately I think there's a separate issue here, that `co_yield -1` is formatted as `co_yield - 1` no matter which C++ standard is used. I'd like to address that in a separate commit, if that's alright. For now, I removed the test verifying the C++17 behavior, and instead only test the correct C++20 formatting of `co_yield ++it`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65043





More information about the cfe-commits mailing list