forked from OSchip/llvm-project
9657385960
Summary: This patch would cause clang emit more diagnostics, but it is much better than https://reviews.llvm.org/D76831 ```cpp struct A { A(int); ~A() = delete; }; void k() { A a; } ``` before the patch: /tmp/t3.cpp:24:5: error: no matching constructor for initialization of 'A' A a; ^ /tmp/t3.cpp:20:3: note: candidate constructor not viable: requires 1 argument, but 0 were provided A(int); ^ /tmp/t3.cpp:19:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 0 were provided struct A { After the patch: /tmp/t3.cpp:24:5: error: no matching constructor for initialization of 'A' A a; ^ /tmp/t3.cpp:20:3: note: candidate constructor not viable: requires 1 argument, but 0 were provided A(int); ^ /tmp/t3.cpp:19:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 0 were provided struct A { ^ /tmp/t3.cpp:24:5: error: attempt to use a deleted function A a; ^ /tmp/t3.cpp:21:3: note: '~A' has been explicitly marked deleted here ~A() = delete; Reviewers: sammccall Reviewed By: sammccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D77395 |
||
---|---|---|
.. | ||
dr0xx.cpp | ||
dr1xx.cpp | ||
dr2xx.cpp | ||
dr3xx.cpp | ||
dr4xx.cpp | ||
dr5xx.cpp | ||
dr6xx.cpp | ||
dr7xx.cpp | ||
dr9xx.cpp | ||
dr10xx.cpp | ||
dr11xx.cpp | ||
dr12xx.cpp | ||
dr13xx.cpp | ||
dr14xx.cpp | ||
dr15xx.cpp | ||
dr16xx.cpp | ||
dr17xx.cpp | ||
dr18xx.cpp | ||
dr19xx.cpp | ||
dr20xx.cpp | ||
dr21xx.cpp | ||
dr22xx.cpp | ||
dr23xx.cpp | ||
dr118.cpp | ||
dr158.cpp | ||
dr412.cpp | ||
dr1748.cpp |