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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 8 08:41:32 PST 2022


aaron.ballman 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;
----------------
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`.


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

https://reviews.llvm.org/D137386



More information about the cfe-commits mailing list