Merge pull request #5037 from github/igfoo/decltype

C++: decltypes may have multiple expressions
This commit is contained in:
Geoffrey White
2021-01-28 14:44:53 +00:00
committed by GitHub
4 changed files with 4294 additions and 1 deletions

View File

@@ -691,8 +691,28 @@ typedefbase(
int type_id: @type ref
);
/**
* An instance of the C++11 `decltype` operator. For example:
* ```
* int a;
* decltype(1+a) b;
* ```
* Here `expr` is `1+a`.
*
* Sometimes an additional pair of parentheses around the expression
* would change the semantics of this decltype, e.g.
* ```
* struct A { double x; };
* const A* a = new A();
* decltype( a->x ); // type is double
* decltype((a->x)); // type is const double&
* ```
* (Please consult the C++11 standard for more details).
* `parentheses_would_change_meaning` is `true` iff that is the case.
*/
#keyset[id, expr]
decltypes(
unique int id: @decltype,
int id: @decltype,
int expr: @expr ref,
int base_type: @type ref,
boolean parentheses_would_change_meaning: boolean ref

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
description: Change decltype keysets
compatibility: backwards