Skip to content

Commit c906560

Browse files
committed
Fix up expected IR output after rebase.
1 parent 960a41b commit c906560

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

cpp/ql/src/semmle/code/cpp/Type.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,8 @@ class ErroneousType extends BuiltInType {
322322

323323
ErroneousType() { builtintypes(underlyingElement(this),_,1,_,_,_) }
324324

325+
/** Canonical QL class corresponding to this element. */
326+
override string getCanonicalQLClass() { result = "ErroneousType" }
325327
}
326328

327329
/**
@@ -921,6 +923,9 @@ class ReferenceType extends DerivedType {
921923

922924
ReferenceType() { derivedtypes(underlyingElement(this),_,2,_) or derivedtypes(underlyingElement(this),_,8,_) }
923925

926+
/** Canonical QL class corresponding to this element. */
927+
override string getCanonicalQLClass() { result = "ReferenceType" }
928+
924929
override int getPointerIndirectionLevel() {
925930
result = getBaseType().getPointerIndirectionLevel()
926931
}

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,34 @@ bad_asts.cpp:
190190
# 27| Type = [LValueReferenceType]: const Point &
191191
# 27| ValueCategory = prvalue(load)
192192
# 28| 1: [ReturnStmt]: return ...
193+
# 30| [TopLevelFunction]: void Bad::errorExpr()
194+
# 30| params:
195+
# 30| body: [Block]: { ... }
196+
# 31| 0: [DeclStmt]: declaration
197+
# 31| 0: [VariableDeclarationEntry]: definition of intref
198+
# 31| Type = [LValueReferenceType]: int &
199+
# 31| init: [Initializer]: initializer for intref
200+
# 31| expr: [ErrorExpr]: <error expr>
201+
# 31| Type = [ErroneousType]: error
202+
# 31| ValueCategory = prvalue
203+
# 32| 1: [DeclStmt]: declaration
204+
# 32| 0: [VariableDeclarationEntry]: definition of x
205+
# 32| Type = [IntType]: int
206+
# 32| init: [Initializer]: initializer for x
207+
# 32| expr: [ErrorExpr]: <error expr>
208+
# 32| Type = [ErroneousType]: error
209+
# 32| ValueCategory = prvalue
210+
# 33| 2: [ExprStmt]: ExprStmt
211+
# 33| 0: [AssignExpr]: ... = ...
212+
# 33| Type = [IntType]: int
213+
# 33| ValueCategory = lvalue
214+
# 33| 0: [VariableAccess]: x
215+
# 33| Type = [IntType]: int
216+
# 33| ValueCategory = lvalue
217+
#-----| 1: [ErrorExpr]: <error expr>
218+
#-----| Type = [ErroneousType]: error
219+
#-----| ValueCategory = prvalue(load)
220+
# 34| 3: [ReturnStmt]: return ...
193221
clang.cpp:
194222
# 5| [TopLevelFunction]: int* globalIntAddress()
195223
# 5| params:

0 commit comments

Comments
 (0)