[PATCH] D137386: [clang][Interp] Reject invalid declarations and expressions

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 9 00:15:50 PST 2022


tbaeder marked an inline comment as done.
tbaeder added inline comments.


================
Comment at: clang/test/AST/Interp/functions.cpp:88-97
+constexpr int invalid() {
+  // Invalid expression in visit().
+  while(huh) {}
+}
+
+constexpr void invalid2() {
+  int i = 0;
----------------
aaron.ballman wrote:
> There should definitely be diagnostics here, right? There's a use of an undeclared identifier in each function, but also, `invalid()` doesn't have a return statement despite returning an `int`.
Right, I forgot to update the tests, sorry!


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

https://reviews.llvm.org/D137386



More information about the cfe-commits mailing list