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

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 24 11:11:06 PDT 2025


zygoloid wrote:

This error is [produced for the following code](https://github.com/carbon-language/carbon-lang/pull/5170):
```c++
template <typename InputKeyT, typename InputKeyContextT>
class SetView {
  SetView(SetView<std::remove_const_t<KeyT>, KeyContextT> 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.

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


More information about the cfe-commits mailing list