[all-commits] [llvm/llvm-project] fe0d3e: [Sema] Diagnose by-value copy constructors in temp...

Kuo, Mei-Chun via All-commits all-commits at lists.llvm.org
Wed Mar 12 21:53:03 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fe0d3e3764961b62f43f1b129f30aaec5f30bc16
      https://github.com/llvm/llvm-project/commit/fe0d3e3764961b62f43f1b129f30aaec5f30bc16
  Author: Kuo, Mei-Chun <94007620+Megan0704-1 at users.noreply.github.com>
  Date:   2025-03-13 (Thu, 13 Mar 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaDeclCXX.cpp
    A clang/test/SemaCXX/copy-ctor-template.cpp
    M clang/test/SemaTemplate/constructor-template.cpp

  Log Message:
  -----------
  [Sema] Diagnose by-value copy constructors in template instantiations (#130866)

Fixes #80963 

This PR ensures Clang diagnoses by-value copy constructors in implicitly
instantiated class templates (e.g., `A<int, int>(A<int, int>)`), per
[class.copy.ctor].

Changes: 
- Remove `TSK_ImplicitInstantiation` check in `SemaDeclCXX.cpp`.
- Add `!isFunctionTemplateSpecialization()` to skip templated
constructors.
- Add regression tests.



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