tbaeder marked 3 inline comments as done.
tbaeder added inline comments.

================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1127
         return false;
-      if (!this->emitInitGlobal(*T, *I, VD))
+    }
+  } else {
----------------
aaron.ballman wrote:
> and if we have no `GlobalIndex`?
> 
> Should this instead be:
> ```
> if (auto GlobalIndex = P.getGlobal(VD); !GlobalIndex || 
> !this->emitGetPtrGlobal(*GlobalIndex, VD))
>   return false;
> ```
> 
I mean, that shouldn't happen because the `visitVarDecl` call before would've 
returned `false` in that case.


================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1161
+      if (VarT) {
+        if (!this->visit(Init))
           return false;
----------------
aaron.ballman wrote:
> What if `Init` is `nullptr`?
Global variables (or local constexpr ones) must have an initializer, no?


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

https://reviews.llvm.org/D136815

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

Reply via email to