As discussed in [[ https://bugs.llvm.org/show_bug.cgi?id=38166 | PR38166 ]], we need to be able to distinqush whether the cast
we are visiting is actually a cast, or part of an `ExplicitCast`.
There are at least twofour ways to get there:
1. Introduce a new `CastKind`, and use it instead of `IntegralCast` if we are in `ExplicitCast`.
Would work, but does not scale - what if we will need more of these cast kinds?
2. Introduce a flag in `CastExprBits`, whether this cast is part of `ExplicitCast` or not.
Would work, but it isn't immediately clear where it needs to be set.
2. Fix `ScalarExprEmitter::VisitCastExpr()` to visit these `NoOp` casts.
As pointed out by @rsmith, CodeGenFunction::EmitMaterializeTemporaryExpr calls
skipRValueSubobjectAdjustments, which steps over the CK_NoOp cast`,
which explains why we currently don't visit those.
Now, the problem is, t This is a very specific area of clang.
I'm not familiar with it.
At firstprobably impossible, when i saw these test regressionsas @efriedma points out, i immediately panicked,
But now that i have actually looked at them in detail, at least in the case of `test/CodeGenCXX/cxx0x-initializer-*`,that is intentional as per `[class.temporary]` in the standard
as far as i can tell, only the IR is different,3. the assembly is still exactly the same.And the simplest one, Or i'm really failing to look.just record which NoOp casts we skip.
So i'm not sure whether these test changes are really ok or not, thus i'm posting this differential
It just kinda works as-is afterwards.