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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 9 11:14:18 PST 2022


aaron.ballman added inline comments.


================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1235-1236
 bool ByteCodeExprGen<Emitter>::visitDecl(const VarDecl *VD) {
-  Optional<PrimType> VarT = classify(VD->getType());
+  if (VD->isInvalidDecl())
+    return false;
 
----------------
Because we can't find a case where we hit this, I think we should try asserting instead.


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

https://reviews.llvm.org/D137386



More information about the cfe-commits mailing list