Commit ff9dc9c
[clang] Fix 2 bugs with parenthesized aggregate initialization
* Fix an issue where temporaries initialized via parenthesized aggregate
initialization don't get destroyed.
* Fix an issue where aggregate initialization omits calls to class
members' move constructors after a TreeTransform. This occurs because
the CXXConstructExpr wrapping the call to the move constructor gets
unboxed during a TreeTransform of the wrapping FunctionalCastExpr (as with a
InitListExpr), but unlike InitListExpr, we dont reperform the
InitializationSequence for the list's expressions to regenerate the
CXXConstructExpr. This patch fixes this bug by treating
CXXParenListInitExpr identically to InitListExpr in this regard.
Fixes #61145
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D146465
(cherry picked from commit 7df3c71)1 parent 3cc0a56 commit ff9dc9c
File tree
5 files changed
+90
-15
lines changed- clang
- lib
- AST
- Sema
- test
- CodeGen
- SemaCXX
5 files changed
+90
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1963 | 1963 | | |
1964 | 1964 | | |
1965 | 1965 | | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
1966 | 1970 | | |
1967 | 1971 | | |
1968 | 1972 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9181 | 9181 | | |
9182 | 9182 | | |
9183 | 9183 | | |
| 9184 | + | |
| 9185 | + | |
9184 | 9186 | | |
9185 | 9187 | | |
9186 | 9188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3137 | 3137 | | |
3138 | 3138 | | |
3139 | 3139 | | |
| 3140 | + | |
| 3141 | + | |
| 3142 | + | |
| 3143 | + | |
| 3144 | + | |
| 3145 | + | |
| 3146 | + | |
3140 | 3147 | | |
3141 | 3148 | | |
3142 | 3149 | | |
| |||
3866 | 3873 | | |
3867 | 3874 | | |
3868 | 3875 | | |
3869 | | - | |
3870 | | - | |
3871 | | - | |
3872 | | - | |
3873 | | - | |
3874 | | - | |
3875 | | - | |
3876 | | - | |
3877 | | - | |
3878 | | - | |
3879 | 3876 | | |
3880 | 3877 | | |
3881 | 3878 | | |
| |||
14075 | 14072 | | |
14076 | 14073 | | |
14077 | 14074 | | |
14078 | | - | |
14079 | | - | |
14080 | | - | |
| 14075 | + | |
| 14076 | + | |
14081 | 14077 | | |
14082 | 14078 | | |
14083 | 14079 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
72 | 93 | | |
73 | 94 | | |
74 | 95 | | |
| |||
349 | 370 | | |
350 | 371 | | |
351 | 372 | | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
0 commit comments