Skip to content

Commit d953a9a

Browse files
authored
Merge pull request github#15662 from jketema/destructors6
C++: Support destructors for range-based for-loops
2 parents b405c5f + f9d391d commit d953a9a

File tree

1 file changed

+66
-2
lines changed

1 file changed

+66
-2
lines changed

cpp/ql/test/library-tests/ir/ir/PrintAST.expected

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9450,8 +9450,12 @@ ir.cpp:
94509450
# 1068| <params>:
94519451
# 1068| getParameter(0): [Parameter] (unnamed parameter 0)
94529452
# 1068| Type = [IntType] int
9453+
# 1069| [Destructor] void vector<ClassWithDestructor>::~vector()
9454+
# 1069| <params>:
94539455
# 1069| [Destructor] void vector<T>::~vector()
94549456
# 1069| <params>:
9457+
# 1069| [Destructor] void vector<int>::~vector()
9458+
# 1069| <params>:
94559459
# 1070| [ConstMemberFunction] vector<ClassWithDestructor>::iterator vector<ClassWithDestructor>::begin() const
94569460
# 1070| <params>:
94579461
# 1070| [ConstMemberFunction] vector<T>::iterator vector<T>::begin() const
@@ -16622,6 +16626,18 @@ ir.cpp:
1662216626
# 2155| Type = [PlainCharType] char
1662316627
# 2155| Value = [CharLiteral] 97
1662416628
# 2155| ValueCategory = prvalue
16629+
# 2154| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor
16630+
# 2154| Type = [VoidType] void
16631+
# 2154| ValueCategory = prvalue
16632+
# 2154| getQualifier(): [VariableAccess] y
16633+
# 2154| Type = [Class] ClassWithDestructor
16634+
# 2154| ValueCategory = lvalue
16635+
# 2154| getImplicitDestructorCall(0): [DestructorCall] call to ~vector
16636+
# 2154| Type = [VoidType] void
16637+
# 2154| ValueCategory = prvalue
16638+
# 2154| getQualifier(): [VariableAccess] ys
16639+
# 2154| Type = [ClassTemplateInstantiation,Struct] vector<ClassWithDestructor>
16640+
# 2154| ValueCategory = lvalue
1662516641
# 2154| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
1662616642
# 2154| Type = [NestedStruct] iterator
1662716643
# 2154| ValueCategory = lvalue
@@ -16754,12 +16770,36 @@ ir.cpp:
1675416770
# 2159| Value = [CStyleCast] 98
1675516771
# 2159| ValueCategory = prvalue
1675616772
# 2160| getThen(): [ReturnStmt] return ...
16757-
# 2172| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor
16773+
# 2157| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor
16774+
# 2157| Type = [VoidType] void
16775+
# 2157| ValueCategory = prvalue
16776+
# 2157| getQualifier(): [VariableAccess] y
16777+
# 2157| Type = [Class] ClassWithDestructor
16778+
# 2157| ValueCategory = lvalue
16779+
# 2157| getImplicitDestructorCall(1): [DestructorCall] call to ~vector
16780+
# 2157| Type = [VoidType] void
16781+
# 2157| ValueCategory = prvalue
16782+
# 2157| getQualifier(): [VariableAccess] ys
16783+
# 2157| Type = [ClassTemplateInstantiation,Struct] vector<ClassWithDestructor>
16784+
# 2157| ValueCategory = lvalue
16785+
# 2172| getImplicitDestructorCall(2): [DestructorCall] call to ~ClassWithDestructor
1675816786
# 2172| Type = [VoidType] void
1675916787
# 2172| ValueCategory = prvalue
1676016788
# 2172| getQualifier(): [VariableAccess] x
1676116789
# 2172| Type = [Class] ClassWithDestructor
1676216790
# 2172| ValueCategory = lvalue
16791+
# 2157| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor
16792+
# 2157| Type = [VoidType] void
16793+
# 2157| ValueCategory = prvalue
16794+
# 2157| getQualifier(): [VariableAccess] y
16795+
# 2157| Type = [Class] ClassWithDestructor
16796+
# 2157| ValueCategory = lvalue
16797+
# 2157| getImplicitDestructorCall(0): [DestructorCall] call to ~vector
16798+
# 2157| Type = [VoidType] void
16799+
# 2157| ValueCategory = prvalue
16800+
# 2157| getQualifier(): [VariableAccess] ys
16801+
# 2157| Type = [ClassTemplateInstantiation,Struct] vector<ClassWithDestructor>
16802+
# 2157| ValueCategory = lvalue
1676316803
# 2157| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
1676416804
# 2157| Type = [NestedStruct] iterator
1676516805
# 2157| ValueCategory = lvalue
@@ -16867,12 +16907,24 @@ ir.cpp:
1686716907
# 2164| Value = [Literal] 1
1686816908
# 2164| ValueCategory = prvalue
1686916909
# 2165| getThen(): [ReturnStmt] return ...
16870-
# 2172| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor
16910+
# 2163| getImplicitDestructorCall(0): [DestructorCall] call to ~vector
16911+
# 2163| Type = [VoidType] void
16912+
# 2163| ValueCategory = prvalue
16913+
# 2163| getQualifier(): [VariableAccess] ys
16914+
# 2163| Type = [ClassTemplateInstantiation,Struct] vector<int>
16915+
# 2163| ValueCategory = lvalue
16916+
# 2172| getImplicitDestructorCall(1): [DestructorCall] call to ~ClassWithDestructor
1687116917
# 2172| Type = [VoidType] void
1687216918
# 2172| ValueCategory = prvalue
1687316919
# 2172| getQualifier(): [VariableAccess] x
1687416920
# 2172| Type = [Class] ClassWithDestructor
1687516921
# 2172| ValueCategory = lvalue
16922+
# 2163| getImplicitDestructorCall(0): [DestructorCall] call to ~vector
16923+
# 2163| Type = [VoidType] void
16924+
# 2163| ValueCategory = prvalue
16925+
# 2163| getQualifier(): [VariableAccess] ys
16926+
# 2163| Type = [ClassTemplateInstantiation,Struct] vector<int>
16927+
# 2163| ValueCategory = lvalue
1687616928
# 2163| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
1687716929
# 2163| Type = [NestedStruct] iterator
1687816930
# 2163| ValueCategory = lvalue
@@ -16996,6 +17048,18 @@ ir.cpp:
1699617048
# 2171| getQualifier(): [VariableAccess] z1
1699717049
# 2171| Type = [Class] ClassWithDestructor
1699817050
# 2171| ValueCategory = lvalue
17051+
# 2168| getImplicitDestructorCall(2): [DestructorCall] call to ~ClassWithDestructor
17052+
# 2168| Type = [VoidType] void
17053+
# 2168| ValueCategory = prvalue
17054+
# 2168| getQualifier(): [VariableAccess] y
17055+
# 2168| Type = [Class] ClassWithDestructor
17056+
# 2168| ValueCategory = lvalue
17057+
# 2168| getImplicitDestructorCall(0): [DestructorCall] call to ~vector
17058+
# 2168| Type = [VoidType] void
17059+
# 2168| ValueCategory = prvalue
17060+
# 2168| getQualifier(): [VariableAccess] ys
17061+
# 2168| Type = [ClassTemplateInstantiation,Struct] vector<ClassWithDestructor>
17062+
# 2168| ValueCategory = lvalue
1699917063
# 2168| getUpdate().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
1700017064
# 2168| Type = [NestedStruct] iterator
1700117065
# 2168| ValueCategory = lvalue

0 commit comments

Comments
 (0)