NoQ added a comment.

In https://reviews.llvm.org/D35041#801073, @alexshap wrote:

> evalCastFromNonLoc is actually called there (and that's how i ran into this 
> issue) because of (a bit unexpected to me) ImplicitCastExpr 'LValueToRValue' 
> inside switch


Yeah, but the `NonLoc` that's being casted is definitely not 
`nonloc::LocAsInteger`.
And i also tried to run your test with only `BasicValueFactory` fix and it 
passed.

In https://reviews.llvm.org/D35041#801073, @alexshap wrote:

> evalCastFromLoc - that's hard to me - so far i have not found a valid 
> compilable c++ code to cast a pointer to bool enum.


I didn't see if that's exactly what we're looking for, but the following 
compiles and crashes:

  EnumBool E = static_cast<EnumBool>((intptr_t)nullptr);
  switch (E) {
  case EnumBool::F:
    return false;
  }
  return true;


Repository:
  rL LLVM

https://reviews.llvm.org/D35041



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to