@@ -13,7 +13,7 @@ import cpp
1313
1414string kindstr ( Class c )
1515{
16- exists ( int kind | usertypes ( c , _, kind ) |
16+ exists ( int kind | usertypes ( unresolveElement ( c ) , _, kind ) |
1717 ( kind = 1 and result = "Struct" ) or
1818 ( kind = 2 and result = "Class" ) or
1919 ( kind = 6 and result = "Template class" )
@@ -48,37 +48,38 @@ predicate masterVde(VariableDeclarationEntry master, VariableDeclarationEntry vd
4848
4949class VariableDeclarationGroup extends @var_decl {
5050 VariableDeclarationGroup ( ) {
51- not previousVde ( _, this )
51+ not previousVde ( _, mkElement ( this ) )
5252 }
5353 Class getClass ( ) {
54- vdeInfo ( this , result , _, _)
54+ vdeInfo ( mkElement ( this ) , result , _, _)
5555 }
5656
5757 // pragma[noopt] since otherwise the two locationInfo relations get join-ordered
5858 // after each other
5959 pragma [ noopt]
6060 predicate hasLocationInfo ( string path , int startline , int startcol , int endline , int endcol ) {
61- exists ( VariableDeclarationEntry last , Location lstart , Location lend |
62- masterVde ( this , last ) and
61+ exists ( Element thisElement , VariableDeclarationEntry last , Location lstart , Location lend |
62+ thisElement = mkElement ( this ) and
63+ masterVde ( thisElement , last ) and
6364 this instanceof VariableDeclarationGroup and
6465 not previousVde ( last , _) and
65- exists ( VariableDeclarationEntry vde | vde = this and vde instanceof VariableDeclarationEntry and vde .getLocation ( ) = lstart ) and
66+ exists ( VariableDeclarationEntry vde | vde = mkElement ( this ) and vde instanceof VariableDeclarationEntry and vde .getLocation ( ) = lstart ) and
6667 last .getLocation ( ) = lend and
6768 lstart .hasLocationInfo ( path , startline , startcol , _, _) and
6869 lend .hasLocationInfo ( path , _, _, endline , endcol )
6970 )
7071 }
7172
7273 string toString ( ) {
73- if previousVde ( this , _) then
74+ if previousVde ( mkElement ( this ) , _) then
7475 result = "group of "
7576 + strictcount ( string name
7677 | exists ( VariableDeclarationEntry vde
77- | masterVde ( this , vde ) and
78+ | masterVde ( mkElement ( this ) , vde ) and
7879 name = vde .getName ( ) ) )
7980 + " fields here"
8081 else
81- result = "declaration of " + this .( VariableDeclarationEntry ) .getVariable ( ) .getName ( )
82+ result = "declaration of " + mkElement ( this ) .( VariableDeclarationEntry ) .getVariable ( ) .getName ( )
8283 }
8384}
8485
0 commit comments