================
@@ -432,7 +443,8 @@ void CodeGenFunction::EmitStaticVarDecl(const VarDecl &D,
   bool isCudaSharedVar = getLangOpts().CUDA && getLangOpts().CUDAIsDevice &&
                          D.hasAttr<CUDASharedAttr>();
   // If this value has an initializer, emit it.
-  if (D.getInit() && !isCudaSharedVar) {
+  if (D.getInit() && !isCudaSharedVar &&
+      !(D.isUsableInConstantExpressions(getContext()) && D.isStaticLocal())) {
----------------
Fznamznon wrote:

>  need to see what happens a bit more to avoid that check...

So, the problem is that `EmitDeferred` is very global 
variable/function-oriented. This is the reason I added the checks. Does it make 
sense to defer non-static variables that end up somehow being treated as static 
ones?

https://github.com/llvm/llvm-project/pull/156933
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to