[clang] [Format] Fix isStartOfName to recognize attributes (PR #76804)
    Owen Pan via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Mon Jan  8 17:23:01 PST 2024
    
    
  
================
@@ -2209,7 +2209,8 @@ class AnnotatingParser {
         (!NextNonComment && !Line.InMacroBody) ||
         (NextNonComment &&
          (NextNonComment->isPointerOrReference() ||
-          NextNonComment->isOneOf(tok::identifier, tok::string_literal)))) {
+          (Line.InPragmaDirective &&
+           NextNonComment->isOneOf(tok::identifier, tok::string_literal))))) {
----------------
owenca wrote:
```suggestion
          NextNonComment->is(tok::string_literal) ||
          (Line.InPragmaDirective && NextNonComment->is(tok::identifier))))) {
```
https://github.com/llvm/llvm-project/pull/76804
    
    
More information about the cfe-commits
mailing list