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

via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 12 14:20:26 PDT 2025


Megan0704-1 wrote:

@cor3ntin 
Thank you for flagging the test failures! 

I’ve investigated them, and here’s what I found: 
Failed Tests in constructor-template.cpp: 
- The failures occurred because the test wasn’t annotated to expect the new diagnostics introduced by the fix (e.g., A<int, int> instantiations now emit errors for invalid by-value copy constructors). 

Fix it by updating the test to: 
- Add expected-error to lines 142, 159, 172 (invalid by-value constructors when T = U). 
- Add expected-note to lines 147, 164, 176 (template instantiation points). 
- Remove an incorrect expected-error from line 76 (valid template specialization). 

Please Let me know if further adjustments are needed~

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


More information about the cfe-commits mailing list