Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 307bef0

Browse files
committed
C++: decltypes may have multiple expressions
1 parent 87b738d commit 307bef0

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

cpp/ql/src/semmlecode.cpp.dbscheme

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,8 +691,28 @@ typedefbase(
691691
int type_id: @type ref
692692
);
693693

694+
/**
695+
* An instance of the C++11 `decltype` operator. For example:
696+
* ```
697+
* int a;
698+
* decltype(1+a) b;
699+
* ```
700+
* Here `expr` is `1+a`.
701+
*
702+
* Sometimes an additional pair of parentheses around the expression
703+
* would change the semantics of this decltype, e.g.
704+
* ```
705+
* struct A { double x; };
706+
* const A* a = new A();
707+
* decltype( a->x ); // type is double
708+
* decltype((a->x)); // type is const double&
709+
* ```
710+
* (Please consult the C++11 standard for more details).
711+
* `parentheses_would_change_meaning` is `true` iff that is the case.
712+
*/
713+
#keyset[id, expr]
694714
decltypes(
695-
unique int id: @decltype,
715+
int id: @decltype,
696716
int expr: @expr ref,
697717
int base_type: @type ref,
698718
boolean parentheses_would_change_meaning: boolean ref

0 commit comments

Comments
 (0)