[PATCH] D137563: [clang][Interp] Check declarations for constexpr-ness in Load() instructions

2022-11-14 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/lib/AST/Interp/Interp.cpp:101 +static bool CheckConstexpr(InterpState , CodePtr OpPC, const Pointer ) { + if (!S.inConstantContext()) Is `CheckConstexpr` descriptive enough? Would something like

[PATCH] D137563: [clang][Interp] Check declarations for constexpr-ness in Load() instructions

2022-11-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. This is wrong if the (constant) initializer is for a legitimate non-constexpr variable declaration. We do a load in `visitDecl()`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137563/new/ https://reviews.llvm.org/D137563

[PATCH] D137563: [clang][Interp] Check declarations for constexpr-ness in Load() instructions

2022-11-07 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Refering to non-constexpr variables in a constant