[AST] Dont invalide VarDecl even the default initializaiton is failed.
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: err...
parent
38609fa9
Please register or sign in to comment