because the result is ignored. The particular example here is with
property l-values, but there could be all sorts of lovely casts that this
isn't safe for. Sink the check into the one case that seems to actually
be capable of honoring this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129397
91177308-0d34-0410-b5e6-
96231b3b80d8
}
void AggExprEmitter::VisitCastExpr(CastExpr *E) {
- if (Dest.isIgnored() && E->getCastKind() != CK_Dynamic) {
- Visit(E->getSubExpr());
- return;
- }
-
switch (E->getCastKind()) {
case CK_Dynamic: {
assert(isa<CXXDynamicCastExpr>(E) && "CK_Dynamic without a dynamic_cast?");
}
case CK_ToUnion: {
+ if (Dest.isIgnored()) break;
+
// GCC union extension
QualType Ty = E->getSubExpr()->getType();
QualType PtrTy = CGF.getContext().getPointerType(Ty);
-// RUN: %clang_cc1 -emit-llvm -o %t %s
+// RUN: %clang_cc1 -emit-llvm-only %s
typedef struct {
unsigned f0;
AnObject* obj;
return (obj.size).width;
}
+
+// rdar://problem/9272392
+void test3(AnObject *obj) {
+ obj.size;
+ (void) obj.size;
+}