@@ -285,33 +285,61 @@ class Expr extends StmtParent, @expr {
285285 * Using the C++11 terminology, this predicate selects expressions whose value category is lvalue.
286286 */
287287 predicate isLValue ( ) {
288- this instanceof StringLiteral /* C++ n3337 - 5.1.1 clause 1 */
289- or this .( ParenthesisExpr ) .getExpr ( ) .isLValue ( ) /* C++ n3337 - 5.1.1 clause 6 */
290- or ( this instanceof VariableAccess and not this instanceof FieldAccess ) /* C++ n3337 - 5.1.1 clauses 8 and 9, variables and data members */
291- or exists ( FunctionAccess fa | fa = this | /* C++ n3337 - 5.1.1 clauses 8 and 9, functions */
288+ // C++ n3337 - 5.1.1 clause 1
289+ this instanceof StringLiteral
290+ or
291+ // C++ n3337 - 5.1.1 clause 6
292+ this .( ParenthesisExpr ) .getExpr ( ) .isLValue ( )
293+ or
294+ // C++ n3337 - 5.1.1 clauses 8 and 9, variables and data members
295+ ( this instanceof VariableAccess and not this instanceof FieldAccess )
296+ or
297+ // C++ n3337 - 5.1.1 clauses 8 and 9, functions
298+ exists ( FunctionAccess fa | fa = this |
292299 fa .getTarget ( ) .isStatic ( )
293- or not fa .getTarget ( ) .isMember ( )
300+ or
301+ not fa .getTarget ( ) .isMember ( )
294302 )
295- or this instanceof ArrayExpr /* C++ n3337 - 5.2.1 clause 1 */
296- or this .getType ( ) instanceof ReferenceType /* C++ n3337 - 5.2.2 clause 10
297- 5.2.5 clause 4, no bullet point
298- 5.2.7 clauses 2 and 5
299- 5.2.9 clause 1
300- 5.2.10 clause 1
301- 5.2.11 clause 1
302- 5.4 clause 1 */
303- or this .( FieldAccess ) .getQualifier ( ) .isLValue ( ) /* C++ n3337 - 5.2.5 clause 4, 2nd bullet point */
304- or this instanceof TypeidOperator /* C++ n3337 - 5.2.8 clause 1 */
305- or this instanceof PointerDereferenceExpr /* C++ n3337 - 5.3.1 clause 1 */
306- or this instanceof PrefixIncrExpr /* C++ n3337 - 5.3.2 clause 1 */
307- or this instanceof PrefixDecrExpr /* C++ n3337 - 5.3.2 clause 2 */
308- or exists ( ConditionalExpr ce | ce = this | /* C++ n3337 - 5.16 clause 4 */
303+ or
304+ // C++ n3337 - 5.2.1 clause 1
305+ this instanceof ArrayExpr
306+ or
307+ // C++ n3337 - 5.2.2 clause 10
308+ // 5.2.5 clause 4, no bullet point
309+ // 5.2.7 clauses 2 and 5
310+ // 5.2.9 clause 1
311+ // 5.2.10 clause 1
312+ // 5.2.11 clause 1
313+ // 5.4 clause 1
314+ this .getType ( ) instanceof ReferenceType
315+ or
316+ // C++ n3337 - 5.2.5 clause 4, 2nd bullet point
317+ this .( FieldAccess ) .getQualifier ( ) .isLValue ( )
318+ or
319+ // C++ n3337 - 5.2.8 clause 1
320+ this instanceof TypeidOperator
321+ or
322+ // C++ n3337 - 5.3.1 clause 1
323+ this instanceof PointerDereferenceExpr
324+ or
325+ // C++ n3337 - 5.3.2 clause 1
326+ this instanceof PrefixIncrExpr
327+ or
328+ // C++ n3337 - 5.3.2 clause 2
329+ this instanceof PrefixDecrExpr
330+ or
331+ // C++ n3337 - 5.16 clause 4
332+ exists ( ConditionalExpr ce | ce = this |
309333 ce .getThen ( ) .isLValue ( ) and
310334 ce .getElse ( ) .isLValue ( ) and
311335 ce .getThen ( ) .getType ( ) = ce .getElse ( ) .getType ( )
312336 )
313- or this instanceof Assignment /* C++ n3337 - 5.17 clause 1 */
314- or this .( CommaExpr ) .getRightOperand ( ) .isLValue ( ) /* C++ n3337 - 5.18 clause 1 */
337+ or
338+ // C++ n3337 - 5.17 clause 1
339+ this instanceof Assignment
340+ or
341+ // C++ n3337 - 5.18 clause 1
342+ this .( CommaExpr ) .getRightOperand ( ) .isLValue ( )
315343 }
316344
317345 /**
0 commit comments