Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0 |
|
#
06013703 |
| 11-Sep-2024 |
yronglin <yronglin777@gmail.com> |
Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (#108039)
The PR reapply https://github.com/llvm/llvm-projec
Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (#108039)
The PR reapply https://github.com/llvm/llvm-project/pull/97308.
- Implement [CWG1815](https://wg21.link/CWG1815): Support lifetime
extension of temporary created by aggregate initialization using a
default member initializer.
- Fix crash that introduced in
https://github.com/llvm/llvm-project/pull/97308. In
`InitListChecker::FillInEmptyInitForField`, when we enter
rebuild-default-init context, we copy all the contents of the parent
context to the current context, which will cause the `MaybeODRUseExprs`
to be lost. But we don't need to copy the entire context, only the
`DelayedDefaultInitializationContext` was required, which is used to
build `SourceLocExpr`, etc.
---------
Signed-off-by: yronglin <yronglin777@gmail.com>
show more ...
|
#
cca54e34 |
| 09-Sep-2024 |
Martin Storsjö <martin@martin.st> |
Revert "Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (#97308)"
This reverts commit 45c8766973bb3bb73dd8d9
Revert "Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (#97308)"
This reverts commit 45c8766973bb3bb73dd8d996231e114dcf45df9f and 049512e39d96995cb373a76cf2d009a86eaf3aab.
This change triggers failed asserts on inputs like this:
struct a { } constexpr b; class c { public: c(a); }; class B { public: using d = int; struct e { enum { f } g; int h; c i; d j{}; }; }; B::e k{B::e::f, int(), b};
Compiled like this:
clang -target x86_64-linux-gnu -c repro.cpp clang: ../../clang/lib/CodeGen/CGExpr.cpp:3105: clang::CodeGen::LValue clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(const clang::DeclRefExpr*): Assertion `(ND->isUsed(false) || !isa<VarDecl>(ND) || E->isNonOdrUse() || !E->getLocation().isValid()) && "Should not use decl without marking it used!"' failed.
show more ...
|
#
45c87669 |
| 08-Sep-2024 |
yronglin <yronglin777@gmail.com> |
Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (#97308)
The PR reapply https://github.com/llvm/llvm-project
Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (#97308)
The PR reapply https://github.com/llvm/llvm-project/pull/92527.
Implemented CWG1815 and fixed the bugs mentioned in the comments of
https://github.com/llvm/llvm-project/pull/92527 and
https://github.com/llvm/llvm-project/pull/87933.
The reason why the original PR was reverted was that errors might occur
during the rebuild.
---------
Signed-off-by: yronglin <yronglin777@gmail.com>
show more ...
|
Revision tags: llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8 |
|
#
7f52e4c7 |
| 06-Jun-2024 |
bgra8 <32298056+bgra8@users.noreply.github.com> |
Revert "Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (#92527)" (#94600)
Reverting due to
https://github.
Revert "Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (#92527)" (#94600)
Reverting due to
https://github.com/llvm/llvm-project/pull/92527#issuecomment-2149120420.
This reverts commit f049d72ac2bcc40fd91d4e95148658021fb24bf1.
Co-authored-by: Bogdan Graur <bgraur@google.com>
show more ...
|
Revision tags: llvmorg-18.1.7 |
|
#
f049d72a |
| 22-May-2024 |
yronglin <yronglin777@gmail.com> |
Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (#92527)
This PR reapply https://github.com/llvm/llvm-projec
Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (#92527)
This PR reapply https://github.com/llvm/llvm-project/pull/87933
Signed-off-by: yronglin <yronglin777@gmail.com>
show more ...
|
Revision tags: llvmorg-18.1.6 |
|
#
224116ab |
| 16-May-2024 |
erichkeane <ekeane@nvidia.com> |
Revert "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (#87933)"
This reverts commit 17daa204feadf9c28fc13b7daa69c3cb
Revert "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (#87933)"
This reverts commit 17daa204feadf9c28fc13b7daa69c3cbe865b238.
Multiple examples on the PR https://github.com/llvm/llvm-project/pull/87933
show regressions, so reverting until they can be fixed in the followup.
show more ...
|
#
17daa204 |
| 12-May-2024 |
yronglin <yronglin777@gmail.com> |
[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (#87933)
This PR complete [DR1815](https://wg21.link/CWG1815) under th
[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (#87933)
This PR complete [DR1815](https://wg21.link/CWG1815) under the guidance
of `FIXME` comments. And reuse `CXXDefaultInitExpr` rewrite machinery to
clone the initializer expression on each use that would lifetime extend
its temporaries.
---------
Signed-off-by: yronglin <yronglin777@gmail.com>
show more ...
|
Revision tags: llvmorg-18.1.5, llvmorg-18.1.4 |
|
#
986d0dba |
| 12-Apr-2024 |
yronglin <yronglin777@gmail.com> |
[Clang] Fix AST dump for {CXXDefaultArgExpr, CXXDefaultInitExpr} (#88269)
This PR fix a AST dump issue since
https://github.com/llvm/llvm-project/pull/80001
When Clang dumps `CXXDefaultArgExpr`/
[Clang] Fix AST dump for {CXXDefaultArgExpr, CXXDefaultInitExpr} (#88269)
This PR fix a AST dump issue since
https://github.com/llvm/llvm-project/pull/80001
When Clang dumps `CXXDefaultArgExpr`/`CXXDefaultInitExpr`, there has no
recursively dump the complete `CXXDefaultArgExpr`/`CXXDefaultInitExpr`.
Since this PR, Clang will recursively dump a
`CXXDefaultArgExpr`/`CXXDefaultInitExpr` node, even if the node has no
rewritten init.
*Consider*:
```
struct A {
int arr[1];
};
struct B {
const A &a = A{{0}};
};
void test() {
B b{};
}
```
*Before*:
```
`-FunctionDecl <line:9:1, line:11:1> line:9:6 test 'void ()'
`-CompoundStmt <col:13, line:11:1>
`-DeclStmt <line:10:3, col:8>
`-VarDecl <col:3, col:7> col:5 b 'B' listinit
`-InitListExpr <col:6, col:7> 'B'
`-CXXDefaultInitExpr <col:7> 'const A' lvalue has rewritten init
`-ExprWithCleanups <line:6:16, col:21> 'const A' lvalue
```
*After*:
```
`-FunctionDecl 0x15a9455a8 <line:9:1, line:11:1> line:9:6 test 'void ()'
`-CompoundStmt 0x15a945850 <col:13, line:11:1>
`-DeclStmt 0x15a945838 <line:10:3, col:8>
`-VarDecl 0x15a945708 <col:3, col:7> col:5 b 'B' listinit
`-InitListExpr 0x15a9457b0 <col:6, col:7> 'B'
`-CXXDefaultInitExpr 0x15a9457f8 <col:7> 'const A' lvalue has rewritten init
`-ExprWithCleanups 0x15a945568 <line:6:16, col:21> 'const A' lvalue
`-MaterializeTemporaryExpr 0x15a945500 <col:16, col:21> 'const A' lvalue extended by Field 0x15a945160 'a' 'const A &'
`-ImplicitCastExpr 0x15a9454e8 <col:16, col:21> 'const A' <NoOp>
`-CXXFunctionalCastExpr 0x15a9454c0 <col:16, col:21> 'A' functional cast to A <NoOp>
`-InitListExpr 0x15a9452c0 <col:17, col:21> 'A'
`-InitListExpr 0x15a945308 <col:18, col:20> 'int[1]'
`-IntegerLiteral 0x15a945210 <col:19> 'int' 0
```
---------
Signed-off-by: yronglin <yronglin777@gmail.com>
show more ...
|