[all-commits] [llvm/llvm-project] 812c96: [clang-format] Handle pointer/reference in macro d...

Owen Pan via All-commits all-commits at lists.llvm.org
Tue Sep 3 19:11:35 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 812c96e8b9354e5e84d513f5b03172db5ad3b491
      https://github.com/llvm/llvm-project/commit/812c96e8b9354e5e84d513f5b03172db5ad3b491
  Author: Owen Pan <owenpiano at gmail.com>
  Date:   2024-09-03 (Tue, 03 Sep 2024)

  Changed paths:
    M clang/lib/Format/TokenAnnotator.cpp
    M clang/lib/Format/TokenAnnotator.h
    M clang/unittests/Format/TokenAnnotatorTest.cpp

  Log Message:
  -----------
  [clang-format] Handle pointer/reference in macro definitions (#107074)

A macro definition needs its own scope stack in the annotator, so we add
the MacroBodyScopes stack and use ScopeStack to refer to it when in the
macro definition body.

Also, we need to have a scope type for a child block because its parent
line is parsed (and thus the scope type for the braces is popped off the
scope stack) before the lines in the child block are.

Fixes #99271.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list