tbaeder added inline comments.
================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:861
+
+ return this->emitConst(T, getIntWidth(ECD->getType()), ECD->getInitVal(),
+ E);
----------------
shafik wrote:
> If I check out `IntExprEvaluator::CheckReferenceDecl(...)` it is checking the
> sign and width match between the expression and the `EnumConstantDecl`. I am
> guessing we need to do that here as well?
I'm having a hard time trying to cause that code to trigger. e.g. in
```
enum Foo : unsigned int {
A = -1,
};
static_assert(A == -1);
```
Both with the new and current interpreter, I get a`-Wc++11-narrowing` error by
default, and the assertion works if I pass `-Wno-c++11-narrowing`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134020/new/
https://reviews.llvm.org/D134020
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits