aaron.ballman added a comment.

In D132727#3755843 <https://reviews.llvm.org/D132727#3755843>, @tbaeder wrote:

> In D132727#3755571 <https://reviews.llvm.org/D132727#3755571>, @aaron.ballman 
> wrote:
>
>> Precommit CI found a relevant failure:
>
> That needs the lvalue-to-rvalue conversion patch first.

Ah, good to know!

FWIW, one concern I've been pondering is building the new constant expression 
interpreter in such a way that we're working on higher-level constructs before 
having the lower-level constructs supported. I worry we're going to miss test 
coverage because we won't be able to add it until some later changes come in 
and then we'll forget to go back and add it. There's nothing specific to this 
review (nor actionable here), but just something to keep in mind as you're 
working on stuff. Implementing things like the type system (lvalue references, 
rvalue references, etc) first and then building other layers on top of that 
(like function calls, variables, etc) when plausible would ease those concerns.



================
Comment at: clang/test/AST/Interp/arrays.cpp:41-44
+template<typename T>
+constexpr T getElementOf(T* array, int i) {
+  return array[i];
+}
----------------
A similar test we might want to add (whenever we get around to references):
```
template <typename T, int N>
constexpr T& getElementOf(T (&array)[N], int I) {
  return array[I];
}
static_assert(getElementOf(foo[2], 3) == &m, "");
```


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

https://reviews.llvm.org/D132727

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

Reply via email to