From 9cc287dff164b27653b60ca6298fbe8faaca02c5 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 21 Mar 2024 14:45:54 +0100 Subject: [PATCH] C++: Handle destructors of range-based for-loop initializer statements --- .../library-tests/ir/ir/PrintAST.expected | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected index ddf5d8b1f5c..aa703b63af7 100644 --- a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected +++ b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected @@ -17357,6 +17357,12 @@ ir.cpp: # 2201| getArgument(0): [VariableAccess] x # 2201| Type = [Class] ClassWithDestructor # 2201| ValueCategory = prvalue(load) +# 2201| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2201| Type = [VoidType] void +# 2201| ValueCategory = prvalue +# 2201| getQualifier(): [ReuseExpr] reuse of temporary object +# 2201| Type = [Class] ClassWithDestructor +# 2201| ValueCategory = xvalue # 2201| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object # 2201| Type = [Class] ClassWithDestructor # 2201| ValueCategory = lvalue @@ -17489,6 +17495,12 @@ ir.cpp: # 2204| getArgument(0): [VariableAccess] x # 2204| Type = [Class] ClassWithDestructor # 2204| ValueCategory = prvalue(load) +# 2204| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2204| Type = [VoidType] void +# 2204| ValueCategory = prvalue +# 2204| getQualifier(): [ReuseExpr] reuse of temporary object +# 2204| Type = [Class] ClassWithDestructor +# 2204| ValueCategory = xvalue # 2204| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object # 2204| Type = [Class] ClassWithDestructor # 2204| ValueCategory = lvalue @@ -17802,6 +17814,12 @@ ir.cpp: # 2215| getArgument(0): [VariableAccess] x # 2215| Type = [Class] ClassWithDestructor # 2215| ValueCategory = prvalue(load) +# 2215| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2215| Type = [VoidType] void +# 2215| ValueCategory = prvalue +# 2215| getQualifier(): [ReuseExpr] reuse of temporary object +# 2215| Type = [Class] ClassWithDestructor +# 2215| ValueCategory = xvalue # 2215| getArgument(0).getFullyConverted(): [TemporaryObjectExpr] temporary object # 2215| Type = [Class] ClassWithDestructor # 2215| ValueCategory = lvalue @@ -19933,6 +19951,12 @@ ir.cpp: # 2416| getQualifier(): [ConstructorCall] call to ClassWithDestructor # 2416| Type = [VoidType] void # 2416| ValueCategory = prvalue +# 2416| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor +# 2416| Type = [VoidType] void +# 2416| ValueCategory = prvalue +# 2416| getQualifier(): [ReuseExpr] reuse of temporary object +# 2416| Type = [Class] ClassWithDestructor +# 2416| ValueCategory = xvalue # 2416| getQualifier().getFullyConverted(): [TemporaryObjectExpr] temporary object # 2416| Type = [Class] ClassWithDestructor # 2416| ValueCategory = prvalue(load)