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 This is problem isbably impossible, this is a very specific area of clang.
I'm not familiar with it.
At firstas @efriedma points out, when i saw these test regressions, i immediately panicked,that is intentional as per `[class.temporary]` in the standard
But now that i have actually looked at them in detail3. And the simplest one, at least in the case of `test/CodeGenCXX/cxx0x-initializer-*`,just record which NoOp casts we skip.
as far as i can tell, only the IR is different, the assembly is still exactly the same. Or i'm really failing to look..
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.