llvm-project/clang/test/CXX/drs
Haojian Wu 9657385960 [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: 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
2020-04-14 12:58:48 +02:00
..
dr0xx.cpp Add missing diagnostic for explicit instantiation declarations naming 2019-04-26 01:51:07 +00:00
dr1xx.cpp When diagnosing the lack of a viable conversion function, also list 2020-01-09 15:15:02 -08:00
dr2xx.cpp Add -std=c++20 flag, replace C++2a with C++20 throughout the Clang 2020-02-18 16:16:37 -08:00
dr3xx.cpp [AST] Dont invalide VarDecl even the default initializaiton is failed. 2020-04-14 12:58:48 +02:00
dr4xx.cpp PR45142: 'template ~X<T>' is ill-formed; reject it rather than crashing. 2020-03-23 15:07:06 -07:00
dr5xx.cpp DR674, PR38883, PR40238: Qualified friend lookup should look for a 2019-01-07 06:00:46 +00:00
dr6xx.cpp Add -std=c++20 flag, replace C++2a with C++20 throughout the Clang 2020-02-18 16:16:37 -08:00
dr7xx.cpp [MS] Consder constexpr globals to be inline, as in C++17 2019-09-11 18:09:10 +00:00
dr9xx.cpp
dr10xx.cpp When substituting previously-checked template arguments into a template 2018-03-08 01:07:33 +00:00
dr11xx.cpp
dr12xx.cpp DR1213: Ignore implicit conversions when determining if an operand of an 2018-06-27 20:29:32 +00:00
dr13xx.cpp Always deduce the lengths of contained parameter packs when deducing a 2020-01-06 17:24:29 -08:00
dr14xx.cpp CWG1423: don't permit implicit conversion of nullptr_t to bool. 2020-02-11 06:52:45 -08:00
dr15xx.cpp When diagnosing the lack of a viable conversion function, also list 2020-01-09 15:15:02 -08:00
dr16xx.cpp When diagnosing an ambiguity, only note the candidates that contribute 2019-10-24 14:58:29 -07:00
dr17xx.cpp DR1753: Don't permit x.NS::~T() as a pseudo-destructor name. 2020-01-24 18:53:50 -08:00
dr18xx.cpp [c++20] P1064R0: Allow virtual function calls in constant expression 2019-05-13 23:35:21 +00:00
dr19xx.cpp Refactor constant evaluation of typeid(T) to track a symbolic type_info 2019-05-17 07:06:46 +00:00
dr20xx.cpp C++ DR2026: static storage duration variables are not zeroed before 2020-02-06 16:37:22 -08:00
dr21xx.cpp PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of type 2019-06-14 17:46:38 +00:00
dr22xx.cpp Fix handling of class member access into a vector type. 2019-08-14 22:57:50 +00:00
dr23xx.cpp CWG2352: Allow qualification conversions during reference binding. 2020-01-09 18:24:06 -08:00
dr118.cpp
dr158.cpp
dr412.cpp
dr1748.cpp