- PR2727.
Also, fix warning in CodeGenTypes for new BlockPointer type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55479
91177308-0d34-0410-b5e6-
96231b3b80d8
Expr(SizeOfAlignOfTypeExprClass, resultType),
isSizeof(issizeof), Ty(argType), OpLoc(op), RParenLoc(rp) {}
+ virtual void Destroy(ASTContext& C);
+
bool isSizeOf() const { return isSizeof; }
QualType getArgumentType() const { return Ty; }
return ::evaluateOffsetOf(C, cast<Expr>(Val)) / CharSize;
}
+void SizeOfAlignOfTypeExpr::Destroy(ASTContext& C) {
+ // Override default behavior of traversing children. We do not want
+ // to delete the type.
+}
+
//===----------------------------------------------------------------------===//
// Child Iterators for iterating over subexpressions/substatements
//===----------------------------------------------------------------------===//
TheModule.addTypeName(TypeName, Res);
return Res;
}
+
+ case Type::BlockPointer: {
+ assert(0 && "FIXME: Cannot get type of block pointer.");
+ }
}
// FIXME: implement.
--- /dev/null
+int f (int x)
+{
+ // sizeof applied to a type should not delete the type.
+ return sizeof (int[x]);
+}