[all-commits] [llvm/llvm-project] d813af: [Format] Fix detection of languages when reading f...

Ben Hamilton (Ben Gertzfield) via All-commits all-commits at lists.llvm.org
Tue Jan 23 12:32:54 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d813af73f70f6b2fd41621d640cc35e595b9da4c
      https://github.com/llvm/llvm-project/commit/d813af73f70f6b2fd41621d640cc35e595b9da4c
  Author: Ben Hamilton (Ben Gertzfield) <benhamilton at google.com>
  Date:   2024-01-23 (Tue, 23 Jan 2024)

  Changed paths:
    A clang/test/Format/dump-config-objc-stdin.m
    M clang/tools/clang-format/ClangFormat.cpp
    M clang/unittests/Format/FormatTestObjC.cpp

  Log Message:
  -----------
  [Format] Fix detection of languages when reading from stdin (#79051)

The code cleanup in #74794 accidentally broke detection of languages by
reading file content from stdin, e.g. via `clang-format -dump-config - <
/path/to/filename`.

This PR adds unit and integration tests to reproduce the issue and adds
a fix.

Fixes: #79023




More information about the All-commits mailing list