efriedma added inline comments.
================ Comment at: clang/lib/CodeGen/CGExprConstant.cpp:1128 + case CK_NoOp: + case CK_NonAtomicToAtomic: return Visit(subExpr, destType); ---------------- I think I'd prefer to continue treating an undecayed function as an "lvalue", to keep things straightforward. To that end, I'd prefer a separate "ConstLValueExprEmitter", or something like that, so ConstExprEmitter only visits rvalues. The new emitter should reuse code from ConstLValueExprEmitter where possible. ================ Comment at: clang/lib/CodeGen/CGExprConstant.cpp:1247 + if (isa<FunctionDecl>(VD)) + return CGM.getModule().getNamedValue(VD->getName()); + return nullptr; ---------------- You 100% can't use `VD->getName()` like this; I'm shocked this isn't causing any test failures. GetAddrOfFunction() resolves names correctly. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156482/new/ https://reviews.llvm.org/D156482 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits