[PATCH] D121550: [clang-format] Fix crash on invalid requires expression

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 13 14:22:47 PDT 2022


curdeius added a comment.

LGTM. And thanks for splitting the patch.



================
Comment at: clang/unittests/Format/TokenAnnotatorTest.cpp:335
+
+  // Invalid Code, but we don't want to crash. See http://llvm.org/PR54350.
+  Tokens = annotate("bool r10 = requires (struct new_struct { int x; } s) { "
----------------
HazardyKnusperkeks wrote:
> curdeius wrote:
> > I'd prefer a valid C++ code (if it's not too complicated) if possible but that's acceptable.
> I thought I'd stick to the bug report. The only thing that comes to my mind does compile on gcc, but clang gives a specific error (which I support, without having looked into the standard). https://gcc.godbolt.org/z/WvT9861b6
Ok, now I see that it's actual test code. It's perfectly fine the.


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

https://reviews.llvm.org/D121550



More information about the cfe-commits mailing list