tbaeder added inline comments.

================
Comment at: clang/test/AST/Interp/functions.cpp:158-174
+struct F {
+  constexpr bool ok() const {
+    return okRecurse();
+  }
+  constexpr bool okRecurse() const {
+    return true;
+  }
----------------
aaron.ballman wrote:
> Should we have some similar tests involving free functions as well?
> 
> Also, how does `BodylessMemberFunction` differ from `F`? They both look to be 
> testing the same thing aside from return types.
> 
> Should we have a test that involves a defaulted special member function that 
> is called explicitly? e.g., https://godbolt.org/z/nzjEcPMKG (Clang is correct 
> here, GCC fails to catch the UB).
We have a test for free-standing functions already higher up:

```
constexpr int f(); // expected-note {{declared here}} \
                   // ref-note {{declared here}}
[...]
constexpr int a() {
  return f();
}
constexpr int f() {
  return 5;
}
static_assert(a() == 5, "");
```

I //think// the two used to test something different, but now they test the 
same thing, yes. I'll remove one of them.

> Should we have a test that involves a defaulted special member function that 
> is called explicitly? e.g., https://godbolt.org/z/nzjEcPMKG (Clang is correct 
> here, GCC fails to catch the UB).

That is also caught but the diagnostics are in the wrong place (and slightly 
different. The old interpreter emits "destruction of dereferenced null pointer" 
while the new one does "member call on dereferenced null pointer").


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

https://reviews.llvm.org/D141591

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

Reply via email to