[all-commits] [llvm/llvm-project] bfafe0: [clang] odr-checker fix for conversion operators

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Fri Jun 27 13:40:33 PDT 2025


  Branch: refs/heads/users/mizvekov/GH144796
  Home:   https://github.com/llvm/llvm-project
  Commit: bfafe061ac970a67f787b5565f5e07ce8328f381
      https://github.com/llvm/llvm-project/commit/bfafe061ac970a67f787b5565f5e07ce8328f381
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2025-06-27 (Fri, 27 Jun 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/ODRHash.h
    M clang/lib/AST/ODRHash.cpp
    M clang/test/Modules/odr_hash.cpp

  Log Message:
  -----------
  [clang] odr-checker fix for conversion operators

This fixes an issue with the ODR checker not using the
as-written type of conversion operators.

The odr-checker in general should not have to deal with canonical
types, as its purpose is to compare same definitions across TUs,
and these need to be same as written, with few exceptions.

Using canonical types is specially problematic when expressions are
involved, as the types which refer to them generally pick an arbitrary
representative expression, and this can lead to false mismatches.

This patch makes sure that when hashing the names of declarations,
the type source info contained in the DeclarationNameInfo is used
instead of the one contained in the DeclarationName, which otherwise
is always canonical.

Fixes https://github.com/llvm/llvm-project/pull/144796



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