[PATCH] D89286: [DebugInfo] Check for templated static data member when adding constant to record static fields
Sylvain Audi via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 13 08:55:09 PDT 2020
saudi added inline comments.
================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:1420
+ if (Var->getInit())
+ Value = Var->evaluateValue();
+ else if (auto *TemplateDecl = Var->getInstantiatedFromStaticDataMember()) {
----------------
I encountered an assert inside `evaluateValue()` call :
`assert(!Init->isValueDependent());`
repro code:
```
template <int VAL> class A {
static constexpr int dep = VAL;
};
A<10> a;
```
Note that it crashed with `static constexp` member but not with `static const`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89286/new/
https://reviews.llvm.org/D89286
More information about the cfe-commits
mailing list