[PATCH] D36876: [IRGen] Evaluate constant static variables referenced through member expressions

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 21 05:17:06 PDT 2017

arphaman added inline comments.

Comment at: lib/CodeGen/CGExprComplex.cpp:156
+    auto Constant = tryEmitDeclRefOrMemberExprAsConstant(
+        ME, ME->getMemberDecl(), /*AllowSideEffects=*/true);
+    if (Constant) {
rsmith wrote:
> If we can (correctly) allow side-effects in the initializer here, why can we not also do so when emitting a `DeclRefExpr`?
I think that DREs can't have side-effects in any case, so I think I can remove that argument.



More information about the cfe-commits mailing list