We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac2bd21 commit 1cea7d4Copy full SHA for 1cea7d4
clang/lib/CodeGen/CGExprConstant.cpp
@@ -1883,10 +1883,10 @@ llvm::Constant *ConstantEmitter::tryEmitPrivateForVarInit(const VarDecl &D) {
1883
1884
// Try to emit the initializer. Note that this can allow some things that
1885
// are not allowed by tryEmitPrivateForMemory alone.
1886
- if (APValue *value = D.evaluateValue()) {
1887
- if (!value->allowConstexprUnknown())
1888
- return tryEmitPrivateForMemory(*value, destType);
1889
- }
+ // Bail out on constexpr-unknown values since they are invalid in CodeGen.
+ if (APValue *value = D.evaluateValue();
+ value && !value->allowConstexprUnknown())
+ return tryEmitPrivateForMemory(*value, destType);
1890
1891
return nullptr;
1892
}
0 commit comments