Index: src/AST/Convert.cpp
===================================================================
--- src/AST/Convert.cpp	(revision 9e23b446e321a87bbf5f2439c8d555a808d5e53c)
+++ src/AST/Convert.cpp	(revision 5cf1228fbb704ea7ccef879b4c60f16486335b9a)
@@ -168,4 +168,7 @@
 		auto attr = get<Attribute>().acceptL( node->attributes );
 
+		// This field can be unset very early on (Pre-FixReturnTypes).
+		auto newType = (type) ? type->clone() : nullptr;
+
 		auto decl = new ObjectDecl(
 			node->name,
@@ -173,5 +176,5 @@
 			LinkageSpec::Spec( node->linkage.val ),
 			bfwd,
-			type->clone(),
+			newType,
 			nullptr, // prevent infinite loop
 			attr,
@@ -1579,11 +1582,12 @@
 
 	virtual void visit( const ObjectDecl * old ) override final {
+		if ( inCache( old ) ) {
+			return;
+		}
 		auto&& type = GET_ACCEPT_1(type, Type);
 		auto&& init = GET_ACCEPT_1(init, Init);
 		auto&& bfwd = GET_ACCEPT_1(bitfieldWidth, Expr);
 		auto&& attr = GET_ACCEPT_V(attributes, Attribute);
-		if ( inCache( old ) ) {
-			return;
-		}
+
 		auto decl = new ast::ObjectDecl(
 			old->location,
Index: src/AST/Decl.hpp
===================================================================
--- src/AST/Decl.hpp	(revision 9e23b446e321a87bbf5f2439c8d555a808d5e53c)
+++ src/AST/Decl.hpp	(revision 5cf1228fbb704ea7ccef879b4c60f16486335b9a)
@@ -315,6 +315,6 @@
 
 	EnumDecl( const CodeLocation& loc, const std::string& name,
-		std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall, Type * base = nullptr,
-		 std::unordered_map< std::string, long long > enumValues = std::unordered_map< std::string, long long >() )
+		std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall, Type const * base = nullptr,
+		std::unordered_map< std::string, long long > enumValues = std::unordered_map< std::string, long long >() )
 	: AggregateDecl( loc, name, std::move(attrs), linkage ), base(base), enumValues(enumValues) {}
 
Index: src/AST/Expr.cpp
===================================================================
--- src/AST/Expr.cpp	(revision 9e23b446e321a87bbf5f2439c8d555a808d5e53c)
+++ src/AST/Expr.cpp	(revision 5cf1228fbb704ea7ccef879b4c60f16486335b9a)
@@ -272,5 +272,5 @@
 	// Adjust the length of the string for the terminator.
 	const Expr * strSize = from_ulong( loc, str.size() + 1 );
-	const Type * strType = new ArrayType( charType, strSize, FixedLen, StaticDim );
+	const Type * strType = new ArrayType( charType, strSize, FixedLen, DynamicDim );
 	const std::string strValue = "\"" + str + "\"";
 	return new ConstantExpr( loc, strType, strValue, std::nullopt );
Index: src/AST/Inspect.cpp
===================================================================
--- src/AST/Inspect.cpp	(revision 5cf1228fbb704ea7ccef879b4c60f16486335b9a)
+++ src/AST/Inspect.cpp	(revision 5cf1228fbb704ea7ccef879b4c60f16486335b9a)
@@ -0,0 +1,35 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// Inspect.cpp -- Helpers to get information from the AST.
+//
+// Author           : Thierry Delisle
+// Created On       : Fri Jun 24 13:16:31 2022
+// Last Modified By : Andrew Beach
+// Last Modified On : Mon Jun 27 15:35:00 2022
+// Update Count     : 1
+//
+
+#include "AST/Decl.hpp"
+#include "AST/Type.hpp"
+
+#include <iostream>
+#include <AST/Print.hpp>
+
+namespace ast {
+
+bool structHasFlexibleArray( const ast::StructDecl * decl ) {
+	if(decl->members.size() == 0) return false;
+	const auto & last = *decl->members.rbegin();
+	auto lastd = last.as<ast::DeclWithType>();
+	// I don't know what this is possible, but it might be.
+	if(!lastd) return false;
+	auto atype = dynamic_cast<const ast::ArrayType *>(lastd->get_type());
+	if(!atype) return false;
+	return !atype->isVarLen && !atype->dimension;
+}
+
+} // namespace ast
Index: src/AST/Inspect.hpp
===================================================================
--- src/AST/Inspect.hpp	(revision 5cf1228fbb704ea7ccef879b4c60f16486335b9a)
+++ src/AST/Inspect.hpp	(revision 5cf1228fbb704ea7ccef879b4c60f16486335b9a)
@@ -0,0 +1,23 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// Inspect.hpp -- Helpers to get information from the AST.
+//
+// Author           : Thierry Delisle
+// Created On       : Fri Jun 24 13:16:31 2022
+// Last Modified By : Andrew Beach
+// Last Modified On : Mon Jun 27 15:35:00 2022
+// Update Count     : 1
+//
+
+#include "AST/Fwd.hpp"
+
+namespace ast {
+
+// Does the structure end in a flexable array declaration?
+bool structHasFlexibleArray( const ast::StructDecl * );
+
+}
Index: src/AST/Pass.impl.hpp
===================================================================
--- src/AST/Pass.impl.hpp	(revision 9e23b446e321a87bbf5f2439c8d555a808d5e53c)
+++ src/AST/Pass.impl.hpp	(revision 5cf1228fbb704ea7ccef879b4c60f16486335b9a)
@@ -681,4 +681,5 @@
 	if ( __visit_children() ) {
 		// unlike structs, traits, and unions, enums inject their members into the global scope
+		maybe_accept( node, &EnumDecl::base );
 		maybe_accept( node, &EnumDecl::params     );
 		maybe_accept( node, &EnumDecl::members    );
Index: src/AST/module.mk
===================================================================
--- src/AST/module.mk	(revision 9e23b446e321a87bbf5f2439c8d555a808d5e53c)
+++ src/AST/module.mk	(revision 5cf1228fbb704ea7ccef879b4c60f16486335b9a)
@@ -37,4 +37,6 @@
 	AST/Init.cpp \
 	AST/Init.hpp \
+	AST/Inspect.cpp \
+	AST/Inspect.hpp \
 	AST/Label.hpp \
 	AST/LinkageSpec.cpp \
