[clang] [Sema] Diagnose by-value copy constructors in template instantiations (PR #130866)

Avi Kivity via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 14 10:20:41 PDT 2025


avikivity wrote:

> This error is [produced for the following code](https://github.com/carbon-language/carbon-lang/pull/5170):
> 
> ```c++
> template <typename KeyT>
> class SetView {
>   SetView(SetView<std::remove_const_t<KeyT>> other_view)
>     requires(!std::same_as<KeyT, std::remove_const_t<KeyT>>);
> };
> ```
> 
> ... which is never an eligible copy constructor. Is that intended? If this is in line with the language rules, perhaps we should file a core issue.
> 
> [Edit: I've mailed the core reflector.]

Can you link to the defect report please?

https://github.com/llvm/llvm-project/pull/130866


More information about the cfe-commits mailing list