[PATCH] D141950: Use find_last_of when seraching for code in getRawCommentForDeclNoCacheImpl

Kugan Vivekanandarajah via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 13 05:14:27 PST 2023


kuganv updated this revision to Diff 496936.
kuganv added a comment.

Rebase


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141950

Files:
  clang/lib/AST/ASTContext.cpp


Index: clang/lib/AST/ASTContext.cpp
===================================================================
--- clang/lib/AST/ASTContext.cpp
+++ clang/lib/AST/ASTContext.cpp
@@ -349,7 +349,7 @@
 
   // There should be no other declarations or preprocessor directives between
   // comment and declaration.
-  if (Text.find_first_of(";{}#@") != StringRef::npos)
+  if (Text.find_last_of(";{}#@") != StringRef::npos)
     return nullptr;
 
   return CommentBeforeDecl;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141950.496936.patch
Type: text/x-patch
Size: 463 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230213/14ac7d05/attachment.bin>


More information about the cfe-commits mailing list