aaron.ballman added a comment.

In D132997#3763367 <https://reviews.llvm.org/D132997#3763367>, @tbaeder wrote:

> In D132997#3763094 <https://reviews.llvm.org/D132997#3763094>, @shafik wrote:
>
>> I think like @aaron.ballman was saying in another PR you should aim for as 
>> complete set of tests as possible even if you have to comment one that can't 
>> work yet. For example cases that would involve `MemberExpr` or `UsingShadow` 
>> for example as well as the cases you mentioned not implemented in your 
>> description.
>
> I get it for the `MaterializeTemporaryExpr`s, but I don't understand why I 
> would add tests using `MemberExpr` now and not when I work on record types 
> (and references have already landed).

The test case I was thinking of for that is:

  struct S {
    int i, j;
  };
  
  constexpr int test() {
    S s{1, 2};
  
    int &j = s.i;
    j += 10;
  
    return j;
  }
  
  static_assert(test() == 11, "");

where the reference is a `DeclRefExpr`. Even if structures don't work yet, 
capturing it as a test case now means we don't have to remember to think about 
"what if there's a reference to this member" when structures are implemented.



================
Comment at: clang/test/AST/Interp/references.cpp:13
+  int a = 20;
+  int &b =a;
+
----------------



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132997/new/

https://reviews.llvm.org/D132997

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to