Commit 4bd2307
authored
[clang][ExprConst] Don't diagnose a non-existent init as not constant (#124575)
This test:
```c++
extern Swim& trident; // expected-note {{declared here}}
constexpr auto& gallagher = typeid(trident); // expected-error {{constexpr variable 'gallagher' must be initialized by a constant expression}}
// expected-note@-1 {{initializer of 'trident' is not a constant expression}}
```
diagnosed the initializer of `trident` as not constant, but `trident`
doesn't even have an initializer. Remove that diagnostic in this case.1 parent 79499f0 commit 4bd2307
File tree
3 files changed
+11
-8
lines changed- clang
- lib/AST
- test/SemaCXX
3 files changed
+11
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3600 | 3600 | | |
3601 | 3601 | | |
3602 | 3602 | | |
3603 | | - | |
3604 | | - | |
| 3603 | + | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
| 3608 | + | |
3605 | 3609 | | |
3606 | 3610 | | |
3607 | 3611 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1462 | 1462 | | |
1463 | 1463 | | |
1464 | 1464 | | |
1465 | | - | |
| 1465 | + | |
1466 | 1466 | | |
1467 | 1467 | | |
1468 | 1468 | | |
| |||
1471 | 1471 | | |
1472 | 1472 | | |
1473 | 1473 | | |
1474 | | - | |
1475 | | - | |
1476 | | - | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
1477 | 1477 | | |
1478 | 1478 | | |
1479 | 1479 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
| |||
0 commit comments