[all-commits] [llvm/llvm-project] 5fc41f: [clang] Fix -Wunused-template in AST and analysis ...

Aditya Medhane via All-commits all-commits at lists.llvm.org
Wed Jun 10 10:30:59 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5fc41f90ebb19f7b28c8a11c477856634a9a868f
      https://github.com/llvm/llvm-project/commit/5fc41f90ebb19f7b28c8a11c477856634a9a868f
  Author: Aditya Medhane <sherlockedaditya at gmail.com>
  Date:   2026-06-10 (Wed, 10 Jun 2026)

  Changed paths:
    M clang/include/clang/Analysis/Analyses/LifetimeSafety/Utils.h
    M clang/lib/AST/ASTImporter.cpp
    M clang/lib/AST/ByteCode/InterpHelpers.h
    M clang/lib/ASTMatchers/Dynamic/Marshallers.h
    M clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
    M clang/lib/CrossTU/CrossTranslationUnit.cpp

  Log Message:
  -----------
  [clang] Fix -Wunused-template in AST and analysis helpers (NFC) (#202977)

Several function templates across clang's AST and analysis code trip
`-Wunused-template`. Three kinds of fix here:

- Header templates with internal linkage (`static`), which gives each TU
its own copy and a latent ODR hazard. Drop `static` in `InterpHelpers.h`
(`handleOverflow`), `Marshallers.h` (the `matcherMarshall*`,
`mergePolyMatchers`, and `outvalueToVariantMatcher` helpers), and
`LifetimeSafety/Utils.h` (`join`). Templates are implicitly inline, so
nothing else changes.
- Dead code: `castAttrAs` in `ASTImporter.cpp` has no callers, so it's
removed.
- Assert-only helpers compiled out in release builds, marked
`[[maybe_unused]]`: `getKeys` in `DataflowAnalysisContext.cpp` and the
`hasBodyOrInit` template in `CrossTranslationUnit.cpp`.

NFC.

Part of #202945.



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