[PATCH] D134853: [clang-format] Correctly annotate UDLs as OverloadedOperator

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 12 12:37:58 PDT 2022


HazardyKnusperkeks accepted this revision.
HazardyKnusperkeks added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:1189-1194
+        // User defined literal without a space
+        if (CurrentToken->Previous->is(tok::string_literal) &&
+            CurrentToken->Previous->TokenText.startswith("\"\"")) {
+          CurrentToken->Previous->setType(TT_OverloadedOperator);
+        }
+        // User defined literal with a space
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134853



More information about the cfe-commits mailing list