[all-commits] [llvm/llvm-project] c70e36: [clang-format] Allow trailing return types in macros

Emilia Dreamer via All-commits all-commits at lists.llvm.org
Thu Mar 23 10:38:57 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c70e360b355ad30a7dd299435aae0324c5033b3f
      https://github.com/llvm/llvm-project/commit/c70e360b355ad30a7dd299435aae0324c5033b3f
  Author: Emilia Dreamer <emilia at rymiel.space>
  Date:   2023-03-23 (Thu, 23 Mar 2023)

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

  Log Message:
  -----------
  [clang-format] Allow trailing return types in macros

The trailing return type arrow checker verifies that a declaration is
being parsed, however, this isn't true when inside of macros.

It turns out the existence of the auto keyword is enough to make
sure that we're dealing with a trailing return type, and whether we're
in a declaration doesn't matter.

Fixes https://github.com/llvm/llvm-project/issues/47664

Reviewed By: HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D141811




More information about the All-commits mailing list