Previously the cleanups (e.g. dtor calls) are inserted into the
outer scope (e.g. function body scope), instead of it's own scope. After
the fix, the cleanups are inserted right after getting the size value.
Details
Details
- Reviewers
rsmith - Commits
- rGdef72aad0bc1: [VLA] Fix the test failure on msvc by specifying the triple.
rGb34d0ef2caa6: [VLA] Handle VLA size expression in a full-expression context.
rC295127: [VLA] Fix the test failure on msvc by specifying the triple.
rC295123: [VLA] Handle VLA size expression in a full-expression context.
rL295127: [VLA] Fix the test failure on msvc by specifying the triple.
rL295123: [VLA] Handle VLA size expression in a full-expression context.
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang/test/SemaCXX/pr30306.cpp | ||
---|---|---|
5 ↗ | (On Diff #70667) | Shouldn't we be (somehow) handling the cleanups from the array bound expression here -- either discarding them or attaching them to the array bound? Looks like TreeTransform::TransformVariableArrayType is missing a call to ActOnFinishFullExpr. If we modify the test to: struct A { A(int); ~A(); }; int f(const A &); template<typename T> void g() { int a[f(3)]; } int main() { g<int>(); } ... we need to register the ~A() destructor to actually be run at some point. |