Index: src/CodeGen/OperatorTable.cc
===================================================================
--- src/CodeGen/OperatorTable.cc	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ src/CodeGen/OperatorTable.cc	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -24,46 +24,46 @@
 	namespace {
 		const OperatorInfo tableValues[] = {
-			{	"?[?]",		"",		"_operator_index",				OT_INDEX			},
-			{	"?{}",		"=",	"_constructor",					OT_CTOR				},
-			{	"^?{}",		"",		"_destructor",					OT_DTOR				},
-			{	"?()",		"",		"_operator_call",				OT_CALL				},
-			{	"?++",		"++",	"_operator_postincr",			OT_POSTFIXASSIGN	},
-			{	"?--",		"--",	"_operator_postdecr",			OT_POSTFIXASSIGN	},
-			{	"*?",		"*",	"_operator_deref",				OT_PREFIX			},
-			{	"+?",		"+",	"_operator_unaryplus",			OT_PREFIX			},
-			{	"-?",		"-",	"_operator_unaryminus",			OT_PREFIX			},
-			{	"~?",		"~",	"_operator_bitnot",				OT_PREFIX			},
-			{	"!?",		"!",	"_operator_lognot",				OT_PREFIX			},
-			{	"++?",		"++",	"_operator_preincr",			OT_PREFIXASSIGN		},
-			{	"--?",		"--",	"_operator_predecr",			OT_PREFIXASSIGN		},
-			{	"?\\?",		"\\",	"_operator_exponential",		OT_INFIX			},
-			{	"?*?",		"*",	"_operator_multiply",			OT_INFIX			},
-			{	"?/?",		"/",	"_operator_divide",				OT_INFIX			},
-			{	"?%?",		"%",	"_operator_modulus",			OT_INFIX			},
-			{	"?+?",		"+",	"_operator_add",				OT_INFIX			},
-			{	"?-?",		"-",	"_operator_subtract",			OT_INFIX			},
-			{	"?<<?",		"<<",	"_operator_shiftleft",			OT_INFIX			},
-			{	"?>>?",		">>",	"_operator_shiftright",			OT_INFIX			},
-			{	"?<?",		"<",	"_operator_less",				OT_INFIX			},
-			{	"?>?",		">",	"_operator_greater",			OT_INFIX			},
-			{	"?<=?",		"<=",	"_operator_lessequal",			OT_INFIX			},
-			{	"?>=?",		">=",	"_operator_greaterequal",		OT_INFIX			},
-			{	"?==?",		"==",	"_operator_equal",				OT_INFIX			},
-			{	"?!=?",		"!=",	"_operator_notequal",			OT_INFIX			},
-			{	"?&?",		"&",	"_operator_bitand",				OT_INFIX			},
-			{	"?^?",		"^",	"_operator_bitxor",				OT_INFIX			},
-			{	"?|?",		"|",	"_operator_bitor",				OT_INFIX			},
-			{	"?=?",		"=",	"_operator_assign",				OT_INFIXASSIGN		},
-			{	"?\\=?",	"\\=",	"_operator_expassign",			OT_INFIXASSIGN		},
-			{	"?*=?",		"*=",	"_operator_multassign",			OT_INFIXASSIGN		},
-			{	"?/=?",		"/=",	"_operator_divassign",			OT_INFIXASSIGN		},
-			{	"?%=?",		"%=",	"_operator_modassign",			OT_INFIXASSIGN		},
-			{	"?+=?",		"+=",	"_operator_addassign",			OT_INFIXASSIGN		},
-			{	"?-=?",		"-=",	"_operator_subassign",			OT_INFIXASSIGN		},
-			{	"?<<=?",	"<<=",	"_operator_shiftleftassign",	OT_INFIXASSIGN		},
-			{	"?>>=?",	">>=",	"_operator_shiftrightassign",	OT_INFIXASSIGN		},
-			{	"?&=?",		"&=",	"_operator_bitandassign",		OT_INFIXASSIGN		},
-			{	"?^=?",		"^=",	"_operator_bitxorassign",		OT_INFIXASSIGN		},
-			{	"?|=?",		"|=",	"_operator_bitorassign",		OT_INFIXASSIGN		},
+			{	"?[?]",   "",     "_operator_index",             "Index",                      OT_INDEX          },
+			{	"?{}",    "=",    "_constructor",                "Constructor",                OT_CTOR           },
+			{	"^?{}",   "",     "_destructor",                 "Destructor",                 OT_DTOR           },
+			{	"?()",    "",     "_operator_call",              "Call Operator",              OT_CALL           },
+			{	"?++",    "++",   "_operator_postincr",          "Postfix Increment",          OT_POSTFIXASSIGN  },
+			{	"?--",    "--",   "_operator_postdecr",          "Postfix Decrement",          OT_POSTFIXASSIGN  },
+			{	"*?",     "*",    "_operator_deref",             "Dereference",                OT_PREFIX         },
+			{	"+?",     "+",    "_operator_unaryplus",         "Plus",                       OT_PREFIX         },
+			{	"-?",     "-",    "_operator_unaryminus",        "Minus",                      OT_PREFIX         },
+			{	"~?",     "~",    "_operator_bitnot",            "Bitwise Not",                OT_PREFIX         },
+			{	"!?",     "!",    "_operator_lognot",            "Logical Not",                OT_PREFIX         },
+			{	"++?",    "++",   "_operator_preincr",           "Prefix Increment",           OT_PREFIXASSIGN   },
+			{	"--?",    "--",   "_operator_predecr",           "Prefix Decrement",           OT_PREFIXASSIGN   },
+			{	"?\\?",   "\\",   "_operator_exponential",       "Exponentiation",             OT_INFIX          },
+			{	"?*?",    "*",    "_operator_multiply",          "Multiplication",             OT_INFIX          },
+			{	"?/?",    "/",    "_operator_divide",            "Division",                   OT_INFIX          },
+			{	"?%?",    "%",    "_operator_modulus",           "Modulo",                     OT_INFIX          },
+			{	"?+?",    "+",    "_operator_add",               "Addition",                   OT_INFIX          },
+			{	"?-?",    "-",    "_operator_subtract",          "Substraction",               OT_INFIX          },
+			{	"?<<?",   "<<",   "_operator_shiftleft",         "Shift Left",                 OT_INFIX          },
+			{	"?>>?",   ">>",   "_operator_shiftright",        "Shift Right",                OT_INFIX          },
+			{	"?<?",    "<",    "_operator_less",              "Less-than",                  OT_INFIX          },
+			{	"?>?",    ">",    "_operator_greater",           "Greater-than",               OT_INFIX          },
+			{	"?<=?",   "<=",   "_operator_lessequal",         "Less-than-or-Equal",         OT_INFIX          },
+			{	"?>=?",   ">=",   "_operator_greaterequal",      "Greater-than-or-Equal",      OT_INFIX          },
+			{	"?==?",   "==",   "_operator_equal",             "Equality",                   OT_INFIX          },
+			{	"?!=?",   "!=",   "_operator_notequal",          "Not-Equal",                  OT_INFIX          },
+			{	"?&?",    "&",    "_operator_bitand",            "Bitwise And",                OT_INFIX          },
+			{	"?^?",    "^",    "_operator_bitxor",            "Bitwise Xor",                OT_INFIX          },
+			{	"?|?",    "|",    "_operator_bitor",             "Bitwise Or",                 OT_INFIX          },
+			{	"?=?",    "=",    "_operator_assign",            "Assignment",                 OT_INFIXASSIGN    },
+			{	"?\\=?",  "\\=",  "_operator_expassign",         "Exponentiation Assignment",  OT_INFIXASSIGN    },
+			{	"?*=?",   "*=",   "_operator_multassign",        "Multiplication Assignment",  OT_INFIXASSIGN    },
+			{	"?/=?",   "/=",   "_operator_divassign",         "Division Assignment",        OT_INFIXASSIGN    },
+			{	"?%=?",   "%=",   "_operator_modassign",         "Modulo Assignment",          OT_INFIXASSIGN    },
+			{	"?+=?",   "+=",   "_operator_addassign",         "Addition Assignment",        OT_INFIXASSIGN    },
+			{	"?-=?",   "-=",   "_operator_subassign",         "Substrction Assignment",     OT_INFIXASSIGN    },
+			{	"?<<=?",  "<<=",  "_operator_shiftleftassign",   "Shift Left Assignment",      OT_INFIXASSIGN    },
+			{	"?>>=?",  ">>=",  "_operator_shiftrightassign",  "Shift Right Assignment",     OT_INFIXASSIGN    },
+			{	"?&=?",   "&=",   "_operator_bitandassign",      "Bitwise And Assignment",     OT_INFIXASSIGN    },
+			{	"?^=?",   "^=",   "_operator_bitxorassign",      "Bitwise Xor Assignment",     OT_INFIXASSIGN    },
+			{	"?|=?",   "|=",   "_operator_bitorassign",       "Bitwise Or Assignment",      OT_INFIXASSIGN    },
 		};
 
@@ -104,4 +104,12 @@
 		OperatorInfo info;
 		return operatorLookup( funcName, info );
+	}
+
+	std::string operatorFriendlyName( const std::string & funcName ) {
+		OperatorInfo info;
+		if( operatorLookup( funcName, info ) ) {
+			return info.friendlyName;
+		}
+		return "";
 	}
 
Index: src/CodeGen/OperatorTable.h
===================================================================
--- src/CodeGen/OperatorTable.h	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ src/CodeGen/OperatorTable.h	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -38,4 +38,5 @@
 		std::string symbol;
 		std::string outputName;
+		std::string friendlyName;
 		OperatorType type;
 	};
@@ -43,4 +44,5 @@
 	bool isOperator( const std::string & funcName );
 	bool operatorLookup( const std::string & funcName, OperatorInfo & info );
+	std::string operatorFriendlyName( const std::string & funcName );
 
 	bool isConstructor( const std::string & );
Index: src/Common/SemanticError.h
===================================================================
--- src/Common/SemanticError.h	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ src/Common/SemanticError.h	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -49,15 +49,16 @@
 struct WarningData {
 	const char * const name;
+	const Severity default_severity;
 	const char * const message;
-	const Severity default_severity;
 };
 
 constexpr WarningData WarningFormats[] = {
-	{"self-assign"            , "self assignment of expression: %s"            , Severity::Warn},
-	{"reference-conversion"   , "rvalue to reference conversion of rvalue: %s" , Severity::Warn},
-	{"qualifiers-zero_t-one_t", "questionable use of type qualifier %s with %s", Severity::Warn},
-	{"aggregate-forward-decl" , "forward declaration of nested aggregate: %s"  , Severity::Warn},
-	{"superfluous-decl"       , "declaration does not allocate storage: %s"    , Severity::Warn},
-	{"gcc-attributes"         , "invalid attribute: %s"                        , Severity::Warn},
+	{"self-assign"            , Severity::Warn    , "self assignment of expression: %s"                          },
+	{"reference-conversion"   , Severity::Warn    , "rvalue to reference conversion of rvalue: %s"               },
+	{"qualifiers-zero_t-one_t", Severity::Warn    , "questionable use of type qualifier %s with %s"              },
+	{"aggregate-forward-decl" , Severity::Warn    , "forward declaration of nested aggregate: %s"                },
+	{"superfluous-decl"       , Severity::Warn    , "declaration does not allocate storage: %s"                  },
+	{"gcc-attributes"         , Severity::Warn    , "invalid attribute: %s"                                      },
+	{"c++-like-copy"          , Severity::Warn    , "Constructor from reference is not a valid copy constructor" },
 };
 
@@ -69,4 +70,5 @@
 	SuperfluousDecl,
 	GccAttributes,
+	CppCopy,
 	NUMBER_OF_WARNINGS, // This MUST be the last warning
 };
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ src/SymTab/Validate.cc	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -311,4 +311,5 @@
 			Stats::Heap::newPass("validate-A");
 			Stats::Time::BlockGuard guard("validate-A");
+			VerifyCtorDtorAssign::verify( translationUnit );  // must happen before autogen, because autogen examines existing ctor/dtors
 			acceptAll( translationUnit, hoistDecls );
 			ReplaceTypedef::replaceTypedef( translationUnit );
@@ -336,5 +337,4 @@
 			Stats::Time::BlockGuard guard("validate-C");
 			acceptAll( translationUnit, genericParams );  // check as early as possible - can't happen before LinkReferenceToTypes_old
-			VerifyCtorDtorAssign::verify( translationUnit );  // must happen before autogen, because autogen examines existing ctor/dtors
 			ReturnChecker::checkFunctionReturns( translationUnit );
 			InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen
@@ -1182,12 +1182,14 @@
 		if ( CodeGen::isCtorDtorAssign( funcDecl->get_name() ) ) { // TODO: also check /=, etc.
 			if ( params.size() == 0 ) {
-				SemanticError( funcDecl, "Constructors, destructors, and assignment functions require at least one parameter " );
+				SemanticError( funcDecl->location, "Constructors, destructors, and assignment functions require at least one parameter." );
 			}
 			ReferenceType * refType = dynamic_cast< ReferenceType * >( params.front()->get_type() );
 			if ( ! refType ) {
-				SemanticError( funcDecl, "First parameter of a constructor, destructor, or assignment function must be a reference " );
+				SemanticError( funcDecl->location, "First parameter of a constructor, destructor, or assignment function must be a reference." );
 			}
 			if ( CodeGen::isCtorDtor( funcDecl->get_name() ) && returnVals.size() != 0 ) {
-				SemanticError( funcDecl, "Constructors and destructors cannot have explicit return values " );
+				if(!returnVals.front()->get_type()->isVoid()) {
+					SemanticError( funcDecl->location, "Constructors and destructors cannot have explicit return values." );
+				}
 			}
 		}
Index: sts/.expect/completeTypeError.txt
===================================================================
--- tests/.expect/completeTypeError.txt	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,141 +1,0 @@
-completeTypeError.cfa:34:1 error: Cannot choose between 2 alternatives for expression
-Generated Cast of:
-  Applying untyped:
-    Name: *?
-  ...to:
-    Name: x
-
-... to: nothing Alternatives are:
-Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of:
-      Application of
-        Variable Expression: *?: forall
-          DT: data type
-          function
-        ... with parameters
-          intrinsic pointer to instance of type DT (not function type)
-        ... returning
-          _retval__operator_deref: reference to instance of type DT (not function type)
-          ... with attributes:
-            Attribute with name: unused
-
-
-      ... to arguments
-        Variable Expression: x: pointer to instance of struct A with body 0
-
-    ... to: nothing
-  (types:
-    void 
-  )
-  Environment:( _83_4_DT ) -> instance of struct A with body 0 (no widening)
-
-
-Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of:
-      Application of
-        Variable Expression: *?: forall
-          DT: data type
-          function
-        ... with parameters
-          intrinsic pointer to instance of type DT (not function type)
-        ... returning
-          _retval__operator_deref: reference to instance of type DT (not function type)
-          ... with attributes:
-            Attribute with name: unused
-
-
-      ... to arguments
-        Variable Expression: x: pointer to instance of struct B with body 1
-
-    ... to: nothing
-  (types:
-    void 
-  )
-  Environment:( _83_4_DT ) -> instance of struct B with body 1 (no widening)
-
-
-
-completeTypeError.cfa:35:1 error: No reasonable alternatives for expression Applying untyped:
-  Name: foo
-...to:
-  Name: v
-
-completeTypeError.cfa:36:1 error: No reasonable alternatives for expression Applying untyped:
-  Name: baz
-...to:
-  Name: v
-
-completeTypeError.cfa:37:1 error: No reasonable alternatives for expression Applying untyped:
-  Name: quux
-...to:
-  Name: v
-
-completeTypeError.cfa:59:1 error: No reasonable alternatives for expression Applying untyped:
-  Name: baz
-...to:
-  Name: y
-
-completeTypeError.cfa:60:1 error: No reasonable alternatives for expression Applying untyped:
-  Name: quux
-...to:
-  Name: y
-
-completeTypeError.cfa:72:1 error: No alternatives with satisfiable assertions for Applying untyped:
-  Name: baz
-...to:
-  Name: z
-
-      Unsatisfiable alternative:
-Cost ( 0, 1, 0, 0, 1, -5, 0 ): Application of
-            Variable Expression: baz: forall
-              T: sized data type
-              ... with assertions
-                ?=?: pointer to function
-                ... with parameters
-                  reference to instance of type T (not function type)
-                  instance of type T (not function type)
-                ... returning
-                  _retval__operator_assign: instance of type T (not function type)
-                  ... with attributes:
-                    Attribute with name: unused
-
-
-                ?{}: pointer to function
-                ... with parameters
-                  reference to instance of type T (not function type)
-                ... returning nothing
-
-                ?{}: pointer to function
-                ... with parameters
-                  reference to instance of type T (not function type)
-                  instance of type T (not function type)
-                ... returning nothing
-
-                ^?{}: pointer to function
-                ... with parameters
-                  reference to instance of type T (not function type)
-                ... returning nothing
-
-
-              function
-            ... with parameters
-              pointer to instance of type T (not function type)
-            ... returning nothing
-
-          ... to arguments
-            Variable Expression: z: pointer to instance of type T (not function type)
-
-        (types:
-          void 
-        )
-        Environment:( _102_0_T ) -> instance of type T (not function type) (no widening)
-
-      Could not satisfy assertion:
-?=?: pointer to function
-        ... with parameters
-          reference to instance of type _102_0_T (not function type)
-          instance of type _102_0_T (not function type)
-        ... returning
-          _retval__operator_assign: instance of type _102_0_T (not function type)
-          ... with attributes:
-            Attribute with name: unused
-
-
Index: sts/.expect/declarationErrors.txt
===================================================================
--- tests/.expect/declarationErrors.txt	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,70 +1,0 @@
-declarationErrors.cfa:16:1 error: duplicate static in declaration of x1: static const volatile short int 
-
-declarationErrors.cfa:17:1 error: conflicting extern & static in declaration of x2: extern const volatile short int 
-
-declarationErrors.cfa:18:1 error: conflicting extern & auto, conflicting extern & static, conflicting extern & static, duplicate extern in declaration of x3: extern const volatile short int 
-
-declarationErrors.cfa:19:1 error: duplicate static in declaration of x4: static const volatile instance of const volatile struct __anonymous0
-  with members
-    i: int 
-   with body
-
-
-declarationErrors.cfa:20:1 error: duplicate const, duplicate static, duplicate volatile in declaration of x5: static const volatile instance of const volatile struct __anonymous1
-  with members
-    i: int 
-   with body
-
-
-declarationErrors.cfa:22:1 error: duplicate static in declaration of x6: static const volatile Int
-
-declarationErrors.cfa:24:1 error: duplicate const in declaration of f01: static inline function
-  with no parameters
-  returning const volatile int 
-
-
-declarationErrors.cfa:25:1 error: duplicate volatile in declaration of f02: static inline function
-  with no parameters
-  returning const volatile int 
-
-
-declarationErrors.cfa:26:1 error: duplicate const in declaration of f03: static inline function
-  with no parameters
-  returning const volatile int 
-
-
-declarationErrors.cfa:27:1 error: duplicate volatile in declaration of f04: static inline function
-  with no parameters
-  returning const volatile int 
-
-
-declarationErrors.cfa:28:1 error: duplicate const in declaration of f05: static inline function
-  with no parameters
-  returning const volatile int 
-
-
-declarationErrors.cfa:29:1 error: duplicate volatile in declaration of f06: static inline function
-  with no parameters
-  returning const volatile int 
-
-
-declarationErrors.cfa:30:1 error: duplicate const in declaration of f07: static inline function
-  with no parameters
-  returning const volatile int 
-
-
-declarationErrors.cfa:31:1 error: duplicate const, duplicate volatile in declaration of f08: static inline function
-  with no parameters
-  returning const volatile int 
-
-
-declarationErrors.cfa:33:1 error: duplicate const, duplicate volatile in declaration of f09: static inline function
-  with no parameters
-  returning const volatile int 
-
-
-declarationErrors.cfa:34:1 error: duplicate const, duplicate _Atomic, duplicate _Atomic, duplicate const, duplicate restrict, duplicate volatile in declaration of f09: static inline function
-  with no parameters
-  returning const restrict volatile _Atomic int 
-
-
Index: sts/.expect/scopeErrors.txt
===================================================================
--- tests/.expect/scopeErrors.txt	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,12 +1,0 @@
-scopeErrors.cfa:2:1 error: duplicate object definition for thisIsAnError: signed int
-scopeErrors.cfa:20:1 error: duplicate function definition for butThisIsAnError: function
-... with parameters
-  double
-... returning
-  _retval_butThisIsAnError: double
-  ... with attributes:
-    Attribute with name: unused
-
-... with body
-  CompoundStmt
-
Index: sts/abort.cfa
===================================================================
--- tests/abort.cfa	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,18 +1,0 @@
-#include <stdlib.h>
-
-int level3() {
-	abort();
-	return 0;
-}
-
-int level2() {
-	return level3();
-}
-
-int level1() {
-	return level2();
-}
-
-int main() {
-	return level1();
-}
Index: sts/completeTypeError.cfa
===================================================================
--- tests/completeTypeError.cfa	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,73 +1,0 @@
-void foo(int *) {}
-void bar(void *) {}
-forall(otype T) void baz(T *);
-forall(dtype T) void qux(T *);
-forall(dtype T | sized(T)) void quux(T *);
-
-struct A;	// incomplete
-struct B {};	// complete
-
-int main() {
-	int * i;
-	void * v;
-
-	A * x;
-	A * y;
-	B * x;
-	B * z;
-
-	// okay
-	*i;
-	*y;
-	*z;
-	foo(i);
-	bar(i);
-	baz(i);
-	qux(i);
-	quux(i);
-
-	bar(v);
-	qux(v);
-
-	// bad
-	*v;
-	*x;	// ambiguous
-	foo(v);
-	baz(v);
-	quux(v);
-}
-
-
-forall(otype T)
-void baz(T * x) {
-	// okay
-	bar(x);
-	baz(x);
-	qux(x);
-	quux(x);
-	*x;
-}
-
-forall(dtype T)
-void qux(T * y) {
-	// okay
-	*y;
-	bar(y);
-	qux(y);
-
-	// bad
-	baz(y);
-	quux(y);
-}
-
-forall(dtype T | sized(T))
-void quux(T * z) {
-	// okay
-	bar(z);
-	qux(z);
-	quux(z);
-	*z;
-
-	// bad
-	baz(z);
-}
Index: sts/context.cfa
===================================================================
--- tests/context.cfa	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,19 +1,0 @@
-// trait declaration
-
-trait has_q( otype T ) {
-	T q( T );
-};
-
-forall( otype z | has_q( z ) ) void f() {
-	trait has_r( otype T, otype U ) {
-		T r( T, T (T,U) );
-	};
-
-	extern otype x, y | has_r( x, y );
-}
-
-//Dummy main
-int main(int argc, char const *argv[])
-{
-	return 0;
-}
Index: sts/declarationErrors.cfa
===================================================================
--- tests/declarationErrors.cfa	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,45 +1,0 @@
-// 
-// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-// 
-// declarationErrors.cfa -- 
-// 
-// Author           : Peter A. Buhr
-// Created On       : Wed Aug 17 08:23:43 2016
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Nov  6 17:52:47 2018
-// Update Count     : 32
-// 
-
-static short int volatile static const x1;				// duplicate static
-extern short int static volatile const x2;				// multiple extern & static
-extern short int auto static volatile static extern const x3; // duplicate and multiple storage classes
-struct { int i; } const static volatile static x4;		// duplicate static
-struct { int i; } const static volatile const static volatile x5; // duplicate static & const & volatile
-typedef int Int;
-static Int volatile static const x6;					// duplicate static
-
-const static inline const volatile int f01();			// duplicate const
-volatile inline const volatile static int f02();		// duplicate volatile
-const inline const volatile int static f03();			// duplicate const
-volatile inline static const volatile int f04();		// duplicate volatile
-const static int const inline volatile f05();			// duplicate const
-volatile int static const volatile inline f06();		// duplicate volatile
-const static const int volatile inline f07();			// duplicate const
-volatile static const int inline const volatile f08();	// duplicate volatile
-
-volatile static const int inline const volatile f09();	// duplicate volatile
-_Atomic _Atomic _Atomic volatile restrict static const const int inline restrict const volatile f09();	// duplicate volatile
-
-//Dummy main
-int main(int argc, char const *argv[])
-{
-	return 0;
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// compile-command: "cfa declarationErrors.cfa" //
-// End: //
Index: tests/errors/.expect/completeType.txt
===================================================================
--- tests/errors/.expect/completeType.txt	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/errors/.expect/completeType.txt	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,141 @@
+errors/completeType.cfa:34:1 error: Cannot choose between 2 alternatives for expression
+Generated Cast of:
+  Applying untyped:
+    Name: *?
+  ...to:
+    Name: x
+
+... to: nothing Alternatives are:
+Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of:
+      Application of
+        Variable Expression: *?: forall
+          DT: data type
+          function
+        ... with parameters
+          intrinsic pointer to instance of type DT (not function type)
+        ... returning
+          _retval__operator_deref: reference to instance of type DT (not function type)
+          ... with attributes:
+            Attribute with name: unused
+
+
+      ... to arguments
+        Variable Expression: x: pointer to instance of struct A with body 0
+
+    ... to: nothing
+  (types:
+    void 
+  )
+  Environment:( _83_4_DT ) -> instance of struct A with body 0 (no widening)
+
+
+Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of:
+      Application of
+        Variable Expression: *?: forall
+          DT: data type
+          function
+        ... with parameters
+          intrinsic pointer to instance of type DT (not function type)
+        ... returning
+          _retval__operator_deref: reference to instance of type DT (not function type)
+          ... with attributes:
+            Attribute with name: unused
+
+
+      ... to arguments
+        Variable Expression: x: pointer to instance of struct B with body 1
+
+    ... to: nothing
+  (types:
+    void 
+  )
+  Environment:( _83_4_DT ) -> instance of struct B with body 1 (no widening)
+
+
+
+errors/completeType.cfa:35:1 error: No reasonable alternatives for expression Applying untyped:
+  Name: foo
+...to:
+  Name: v
+
+errors/completeType.cfa:36:1 error: No reasonable alternatives for expression Applying untyped:
+  Name: baz
+...to:
+  Name: v
+
+errors/completeType.cfa:37:1 error: No reasonable alternatives for expression Applying untyped:
+  Name: quux
+...to:
+  Name: v
+
+errors/completeType.cfa:59:1 error: No reasonable alternatives for expression Applying untyped:
+  Name: baz
+...to:
+  Name: y
+
+errors/completeType.cfa:60:1 error: No reasonable alternatives for expression Applying untyped:
+  Name: quux
+...to:
+  Name: y
+
+errors/completeType.cfa:72:1 error: No alternatives with satisfiable assertions for Applying untyped:
+  Name: baz
+...to:
+  Name: z
+
+      Unsatisfiable alternative:
+Cost ( 0, 1, 0, 0, 1, -5, 0 ): Application of
+            Variable Expression: baz: forall
+              T: sized data type
+              ... with assertions
+                ?=?: pointer to function
+                ... with parameters
+                  reference to instance of type T (not function type)
+                  instance of type T (not function type)
+                ... returning
+                  _retval__operator_assign: instance of type T (not function type)
+                  ... with attributes:
+                    Attribute with name: unused
+
+
+                ?{}: pointer to function
+                ... with parameters
+                  reference to instance of type T (not function type)
+                ... returning nothing
+
+                ?{}: pointer to function
+                ... with parameters
+                  reference to instance of type T (not function type)
+                  instance of type T (not function type)
+                ... returning nothing
+
+                ^?{}: pointer to function
+                ... with parameters
+                  reference to instance of type T (not function type)
+                ... returning nothing
+
+
+              function
+            ... with parameters
+              pointer to instance of type T (not function type)
+            ... returning nothing
+
+          ... to arguments
+            Variable Expression: z: pointer to instance of type T (not function type)
+
+        (types:
+          void 
+        )
+        Environment:( _102_0_T ) -> instance of type T (not function type) (no widening)
+
+      Could not satisfy assertion:
+?=?: pointer to function
+        ... with parameters
+          reference to instance of type _102_0_T (not function type)
+          instance of type _102_0_T (not function type)
+        ... returning
+          _retval__operator_assign: instance of type _102_0_T (not function type)
+          ... with attributes:
+            Attribute with name: unused
+
+
Index: tests/errors/.expect/declaration.txt
===================================================================
--- tests/errors/.expect/declaration.txt	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/errors/.expect/declaration.txt	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,70 @@
+errors/declaration.cfa:16:1 error: duplicate static in declaration of x1: static const volatile short int 
+
+errors/declaration.cfa:17:1 error: conflicting extern & static in declaration of x2: extern const volatile short int 
+
+errors/declaration.cfa:18:1 error: conflicting extern & auto, conflicting extern & static, conflicting extern & static, duplicate extern in declaration of x3: extern const volatile short int 
+
+errors/declaration.cfa:19:1 error: duplicate static in declaration of x4: static const volatile instance of const volatile struct __anonymous0
+  with members
+    i: int 
+   with body
+
+
+errors/declaration.cfa:20:1 error: duplicate const, duplicate static, duplicate volatile in declaration of x5: static const volatile instance of const volatile struct __anonymous1
+  with members
+    i: int 
+   with body
+
+
+errors/declaration.cfa:22:1 error: duplicate static in declaration of x6: static const volatile Int
+
+errors/declaration.cfa:24:1 error: duplicate const in declaration of f01: static inline function
+  with no parameters
+  returning const volatile int 
+
+
+errors/declaration.cfa:25:1 error: duplicate volatile in declaration of f02: static inline function
+  with no parameters
+  returning const volatile int 
+
+
+errors/declaration.cfa:26:1 error: duplicate const in declaration of f03: static inline function
+  with no parameters
+  returning const volatile int 
+
+
+errors/declaration.cfa:27:1 error: duplicate volatile in declaration of f04: static inline function
+  with no parameters
+  returning const volatile int 
+
+
+errors/declaration.cfa:28:1 error: duplicate const in declaration of f05: static inline function
+  with no parameters
+  returning const volatile int 
+
+
+errors/declaration.cfa:29:1 error: duplicate volatile in declaration of f06: static inline function
+  with no parameters
+  returning const volatile int 
+
+
+errors/declaration.cfa:30:1 error: duplicate const in declaration of f07: static inline function
+  with no parameters
+  returning const volatile int 
+
+
+errors/declaration.cfa:31:1 error: duplicate const, duplicate volatile in declaration of f08: static inline function
+  with no parameters
+  returning const volatile int 
+
+
+errors/declaration.cfa:33:1 error: duplicate const, duplicate volatile in declaration of f09: static inline function
+  with no parameters
+  returning const volatile int 
+
+
+errors/declaration.cfa:34:1 error: duplicate const, duplicate _Atomic, duplicate _Atomic, duplicate const, duplicate restrict, duplicate volatile in declaration of f09: static inline function
+  with no parameters
+  returning const restrict volatile _Atomic int 
+
+
Index: tests/errors/.expect/scope.txt
===================================================================
--- tests/errors/.expect/scope.txt	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/errors/.expect/scope.txt	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,12 @@
+errors/scope.cfa:2:1 error: duplicate object definition for thisIsAnError: signed int
+errors/scope.cfa:20:1 error: duplicate function definition for butThisIsAnError: function
+... with parameters
+  double
+... returning
+  _retval_butThisIsAnError: double
+  ... with attributes:
+    Attribute with name: unused
+
+... with body
+  CompoundStmt
+
Index: tests/errors/.expect/signature.txt
===================================================================
--- tests/errors/.expect/signature.txt	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/errors/.expect/signature.txt	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,12 @@
+errors/signature.cfa:2:1 error: Constructors, destructors, and assignment functions require at least one parameter.
+errors/signature.cfa:3:1 error: Constructors, destructors, and assignment functions require at least one parameter.
+errors/signature.cfa:4:1 error: Constructors, destructors, and assignment functions require at least one parameter.
+errors/signature.cfa:5:1 error: First parameter of a constructor, destructor, or assignment function must be a reference.
+errors/signature.cfa:6:1 error: First parameter of a constructor, destructor, or assignment function must be a reference.
+errors/signature.cfa:7:1 error: First parameter of a constructor, destructor, or assignment function must be a reference.
+errors/signature.cfa:10:1 error: First parameter of a constructor, destructor, or assignment function must be a reference.
+errors/signature.cfa:11:1 error: First parameter of a constructor, destructor, or assignment function must be a reference.
+errors/signature.cfa:12:1 error: First parameter of a constructor, destructor, or assignment function must be a reference.
+errors/signature.cfa:13:1 error: First parameter of a constructor, destructor, or assignment function must be a reference.
+errors/signature.cfa:14:1 error: First parameter of a constructor, destructor, or assignment function must be a reference.
+errors/signature.cfa:15:1 error: First parameter of a constructor, destructor, or assignment function must be a reference.
Index: tests/errors/completeType.cfa
===================================================================
--- tests/errors/completeType.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/errors/completeType.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,73 @@
+void foo(int *) {}
+void bar(void *) {}
+forall(otype T) void baz(T *);
+forall(dtype T) void qux(T *);
+forall(dtype T | sized(T)) void quux(T *);
+
+struct A;	// incomplete
+struct B {};	// complete
+
+int main() {
+	int * i;
+	void * v;
+
+	A * x;
+	A * y;
+	B * x;
+	B * z;
+
+	// okay
+	*i;
+	*y;
+	*z;
+	foo(i);
+	bar(i);
+	baz(i);
+	qux(i);
+	quux(i);
+
+	bar(v);
+	qux(v);
+
+	// bad
+	*v;
+	*x;	// ambiguous
+	foo(v);
+	baz(v);
+	quux(v);
+}
+
+
+forall(otype T)
+void baz(T * x) {
+	// okay
+	bar(x);
+	baz(x);
+	qux(x);
+	quux(x);
+	*x;
+}
+
+forall(dtype T)
+void qux(T * y) {
+	// okay
+	*y;
+	bar(y);
+	qux(y);
+
+	// bad
+	baz(y);
+	quux(y);
+}
+
+forall(dtype T | sized(T))
+void quux(T * z) {
+	// okay
+	bar(z);
+	qux(z);
+	quux(z);
+	*z;
+
+	// bad
+	baz(z);
+}
Index: tests/errors/declaration.cfa
===================================================================
--- tests/errors/declaration.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/errors/declaration.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,45 @@
+// 
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+// 
+// declarationErrors.cfa -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Wed Aug 17 08:23:43 2016
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue Nov  6 17:52:47 2018
+// Update Count     : 32
+// 
+
+static short int volatile static const x1;				// duplicate static
+extern short int static volatile const x2;				// multiple extern & static
+extern short int auto static volatile static extern const x3; // duplicate and multiple storage classes
+struct { int i; } const static volatile static x4;		// duplicate static
+struct { int i; } const static volatile const static volatile x5; // duplicate static & const & volatile
+typedef int Int;
+static Int volatile static const x6;					// duplicate static
+
+const static inline const volatile int f01();			// duplicate const
+volatile inline const volatile static int f02();		// duplicate volatile
+const inline const volatile int static f03();			// duplicate const
+volatile inline static const volatile int f04();		// duplicate volatile
+const static int const inline volatile f05();			// duplicate const
+volatile int static const volatile inline f06();		// duplicate volatile
+const static const int volatile inline f07();			// duplicate const
+volatile static const int inline const volatile f08();	// duplicate volatile
+
+volatile static const int inline const volatile f09();	// duplicate volatile
+_Atomic _Atomic _Atomic volatile restrict static const const int inline restrict const volatile f09();	// duplicate volatile
+
+//Dummy main
+int main(int argc, char const *argv[])
+{
+	return 0;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa declarationErrors.cfa" //
+// End: //
Index: tests/errors/scope.cfa
===================================================================
--- tests/errors/scope.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/errors/scope.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,25 @@
+int thisIsAnError;
+int thisIsAnError;
+
+int thisIsNotAnError;
+float thisIsNotAnError;
+
+int thisIsAlsoNotAnError() {
+  int thisIsNotAnError;
+}
+
+int thisIsAlsoNotAnError( double x ) {
+}
+
+double thisIsStillNotAnError( double );
+double thisIsStillNotAnError( double );
+
+double butThisIsAnError( double ) {
+}
+
+double butThisIsAnError( double ) {
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: tests/errors/signature.cfa
===================================================================
--- tests/errors/signature.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/errors/signature.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,15 @@
+// No parameters
+void  ?{}();
+void ^?{}();
+void  ?=?();
+void  ?{}(void);
+void ^?{}(void);
+void  ?=?(void);
+
+// Wrong parameters
+void  ?{}(int);
+void ^?{}(int);
+void  ?=?(int);
+void  ?{}(int *);
+void ^?{}(int *);
+void  ?=?(int *);
Index: sts/namedParmArg.cfa
===================================================================
--- tests/namedParmArg.cfa	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,14 +1,0 @@
-int f1( int i = 3, int *j = 0 ) {}  /* ANSI */
-[int, int ] f2( int i = 3, * int j = 0 ) {}  /* CFA */
-
-int main() {
-    f1();		/* identical calls */
-    f1( 3 );
-    f1( 3, );
-    f1( 3, 0 );
-    f1( 3, j : 0 );
-    f1( j : 0, 3 );
-    f1( i : 3, j : 0 );
-    f1( j : 0, i : 3 );
-    f1( [j, i] : f2() );
-}
Index: sts/occursError.cfa
===================================================================
--- tests/occursError.cfa	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,12 +1,0 @@
-forall( otype T ) void f( void (*)( T, T * ) );
-forall( otype U ) void g( U,  U * );
-forall( otype U ) void h( U *, U );
-
-void test() {
-    f( h );
-    f( g );
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// End: //
Index: sts/scope.cfa
===================================================================
--- tests/scope.cfa	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,73 +1,0 @@
-int x;
-typedef double y;
-typedef float t;
-y z;
-//otype u = struct { int a; double b; };
-typedef struct { int a; double b; } u;
-int f( int y );
-y q;
-struct x { int x; };
-
-y w( y y, u v ) {
-//	otype x | { x t(u); };
-	void ?{}(struct x *);
-	void ^?{}(struct x *);
-	extern struct x t( u );
-	u u = y;
-	struct x z = t(u);
-}
-
-y p;
-
-trait has_u( otype z ) {
-	z u(z);
-};
-
-forall( otype t | has_u( t ) )
-y q( t the_t ) {
-	t y = u( the_t );
-}
-
-t f( y p ) {
-	int y;
-	typedef char x;
-	{
-		x y;
-		typedef x z;
-		{
-			z x;
-			typedef z y;
-			y z = x;
-		}
-		z x = y;
-	}
-	x q = y;
-}
-
-void some_func() {}
-
-t g( void ) {
-	typedef char x;
-//	try {
-		some_func();
-//	} catch ( x x ) {
-//		t y = x;
-//	}
-	x z;
-}
-
-y q( i )												/* K&R style */
-	int i;
-{
-	switch ( i ) {
-		y q = i;
-	  case 0:
-		return q;
-	  default:
-		return i;
-	}
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// End: //
Index: sts/scopeErrors.cfa
===================================================================
--- tests/scopeErrors.cfa	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,25 +1,0 @@
-int thisIsAnError;
-int thisIsAnError;
-
-int thisIsNotAnError;
-float thisIsNotAnError;
-
-int thisIsAlsoNotAnError() {
-  int thisIsNotAnError;
-}
-
-int thisIsAlsoNotAnError( double x ) {
-}
-
-double thisIsStillNotAnError( double );
-double thisIsStillNotAnError( double );
-
-double butThisIsAnError( double ) {
-}
-
-double butThisIsAnError( double ) {
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// End: //
Index: sts/structMember.cfa
===================================================================
--- tests/structMember.cfa	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,100 +1,0 @@
-typedef int TD;
-extern struct TTT {};
-
-struct S {
-	int m1:3, m2:4;
-	int :2;
-	int :3, :4;
-	int m3;
-	int m4, m5, m6;
-	int *m7, *m8, *m9;
-	__extension__ int (*m10)();
-	__extension__ int *(*m11)(int);
-//	TD (TD);
-
-// Cforall declarations
-
-	* int m12, m13;
-	* [ * int ] (int) m14;
-
-// C anonymous declarations (padding)
-
-	int :4;
-	int :4, :6;
-
-// Cforall anonymous declarations (padding)
-
-	int @;
-	TD @;
-	int @, @, @;
-	int * @ , @, @;
-	int * @, * @, * @;
-	* int @, @, @;
-	struct TTT @;
-	TTT @, @;
-	int @ :4, @ :6;
-	* int @, @;
-	int (*@)();
-	int (*@)(int), (*@)(int);
-	* [int](int) @, @;
-	int (**@)( int );
-	* * [int](int) @;
-
-// C aggregate open declarations
-
-	__extension__ union { int i; };
-	struct T { int k; };
-
-// Cforall forward declaration
-
-	struct PPP;
-	__extension__ struct QQQ;
-
-// C useless declarations
-
-	int;
-	TD;
-	unsigned int;
-	__extension__ long double;
-	_Complex;
-	double _Complex;
-	volatile zero_t;
-	const one_t;
-	S;
-	.S;
-	S.T;
-	.S.T;
-	forall( otype S, otype T ) struct W {
-		struct X {};
-	};
-	W(int);
-	W(int).X;
-};
-
-struct S s;
-
-// Cforall Plan 9 declarations
-
-struct UUU {};
-extern struct SSS {
-	inline struct WWW {};
-	inline UUU;
-	inline UUU *, **;
-	inline UUU (*)( int p );
-	inline int;
-	inline int *;
-	inline * int;
-	inline int (*)( int p );
-	inline * [int](int p);
-};
-
-union U {
-	[5] int m1;
-	int m2[5];
-	* int m3;
-	int *m4;
-} u;
-
-// Local Variables: //
-// tab-width: 4 //
-// End: //
Index: sts/subrange.cfa
===================================================================
--- tests/subrange.cfa	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,63 +1,0 @@
-// A small context defining the notion of an ordered otype.  (The standard
-// library should probably contain a context for this purpose.)
-trait ordered(otype T) {
-    int ?<?(T, T), ?<=?(T, T);
-};
-
-// A subrange otype resembling an Ada subotype with a base otype and a range
-// constraint.
-otype subrange(otype base_t | ordered(base_t), base_t low = 0, base_t high = 8) = base_t;
-
-// Note that subrange() can be applied to floating-point and pointer otypes, not
-// just integral otypes.
-//   This requires a "otype generator" extension to Cforall.  Type generators
-// must accept otype and non-otype parameters, which is beyond what we discussed
-// previously.  Type parameters must be usable in the declaration of
-// subsequent parameters: parameter T is used to declare parameters "low"
-// and "high".
-
-// Example usage:
-subrange(unsigned, 1, 31) day_of_month;
-subrange(char, 'a', 'z')  lcase;
-subrange(int, 0, (rand() & 0xF) ) foo;
-
-// What sorts of expressions can be used as arguments of otype generators?  Is
-// "subrange(int, 0, rand() & 0xF)" legal?  Probably.  The nearest C equivalent
-// to the "low" and "high" arguments is the array size in a variable-length
-// array declaration, and C allows assignment expressions there.
-
-// Convenient access to subrange bounds, for instance for iteration:
-forall (otype T, T low, T high)
-T lbound( subrange(T, low, high) v) {
-    return low;
-}
-
-forall (otype T, T low, T high)
-T hbound( subrange(T, low, high) v) {
-    return high;
-}
-
-// Example usage:
-unsigned lday = lbound(day_of_month);
-
-// Assignment from the base otype, with bounds checking.  I'll ignore the issue
-// of exception handling here.  Inlining allows the compiler to eliminate
-// bounds checks.
-forall (otype T | ordered(T), T low, T high)
-inline subrange(T, low, high) ?=?(subrange(T, low, high)* target, T source) {
-    if (low <= source && source <= high) *((T*)target) = source;
-    else abort();
-    return target;
-}
-
-// Assignment between subranges with a common base otype.  The bounds check
-// compares range bounds so that the compiler can optimize checks away when the
-// ranges are known to overlap.
-forall (otype T | ordered(T), T t_low, T t_high, T s_low, T s_high)
-inline subrange(T, t_low, t_high) ?=?(subrange(T, t_low, t_high)* target,
-				      subrange(T, s_low, s_high) source) {
-    if ( (t_low <= s_low || t_low <= source)
-	 && (s_high <= t_high || source <= t_high) ) *((T*)target) = source;
-    else abort();
-    return target;
-}
Index: sts/typeGenerator.cfa
===================================================================
--- tests/typeGenerator.cfa	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,30 +1,0 @@
-context addable( otype T ) {
-	T ?+?( T,T );
-	T ?=?( T*, T);
-};
-
-otype List1( otype T | addable( T ) ) = struct { T data; List1( T ) *next; } *;
-typedef List1( int ) ListOfIntegers;
-//List1( int ) li;
-ListOfIntegers li;
-int f( List1( int ) ( (*g ))( int ) );
-[int] h( * List1( int ) p );							// new declaration syntax
-
-struct( otype T ) S2 { T i; };							// actual definition
-struct( int ) S3 v1, *p;								// expansion and instantiation
-struct( otype T )( int ) S24 { T i; } v2;				// actual definition, expansion and instantiation
-struct( otype T )( int ) { T i; } v2;					// anonymous actual definition, expansion and instantiation
-
-struct( otype T | addable( T ) ) node { T data; struct( T ) node *next; };
-otype List( otype T ) = struct( T ) node *;
-List( int ) my_list;
-
-otype Complex | addable( Complex );
-
-int main() {
-	(struct( int ) node)my_list;
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// End: //
Index: sts/typedef.cfa
===================================================================
--- tests/typedef.cfa	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,47 +1,0 @@
-typedef int T;
-
-void f( void ) {
-    int T( T p ) { return 3; }
-    T( 3 );
-}
-
-struct {
-    T (T);
-} fred = { 3 };
-
-typedef int (*a)(int, char);
-a b;
-
-int g(void) {
-    double a;
-}
-a c;
-
-typedef typeof(3) x, y;  // GCC
-
-x p;
-y q;
-
-int main() {
-    typedef typeof(3) z, p;
-    z w;
-    p x;
-}
-
-// new-style function definitions
-
-typedef [10] * int arrayOf10Pointers;
-arrayOf10Pointers array;
-typedef const * int constantPointer;
-typedef * [ int ]( [] int ) funcPtr;
-typedef [ int ] funcProto( []  int );
-typedef [ int, int ] tupleType;
-typedef * [ int, int ] tupleTypePtr;
-typedef * int c, d;
-typedef [ int ] f( * int ), g;
-typedef [ * [static 10] int ] t;
-typedef [ * [static 10] int x ] h();
-
-// Local Variables: //
-// tab-width: 4 //
-// End: //
Index: sts/typedefDeclarator.cfa
===================================================================
--- tests/typedefDeclarator.cfa	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,120 +1,0 @@
-typedef int
-	 f0,  f1,  f2,  f3,  f4,  f5,  f6,  f7,  f8,  f9,
-	f10, f11, f12, f13, f14, f15, f16, f17, f18, f19,
-	f20, f21, f22, f23, f24, f25, f26, f27, f28, f29,
-	f30, f31, f32, f33, f34, f35, f36, f37, f38, f39,
-	f40, f41, f42, f43, f44, f45, f46, f47, f48, f49,
-	f50, f51, f52, f53, f54, f55, f56, f57, f58, f59,
-	f60, f61, f62, f63, f64, f65, f66, f67, f68, f69,
-	f70, f71, f72, f73, f74, f75, f76, f77, f78, f79,
-	f80, f81, f82, f83, f84, f85, f86, f87, f88, f89;
-
-int main() {
-	//int f0[]();
-	//int (f0[])();
-	//int f0()[];
-	//int f0()();
-	//int (*f0)()();
-	//int ((*f0())())[];
-	
-	int f1;
-	int (f2);
-
-	int *f3;
-	int **f4;
-	int * const *f5;
-	int * const * const f6;
-
-	int *(f7);
-	int **(f8);
-	int * const *(f9);
-	int * const * const (f10);
-
-	int (*f11);
-	int (**f12);
-	int (* const *f13);
-	int (* const * const f14);
-
-	int f15[];
-	int f16[10];
-	int (f17[]);
-	int (f18[10]);
-
-	int *f19[];
-	int *f20[10];
-	int **f21[];
-	int **f22[10];
-	int * const *f23[];
-	int * const *f24[10];
-	int * const * const f25[];
-	int * const * const f26[10];
-
-	int *(f27[]);
-	int *(f28[10]);
-	int **(f29[]);
-	int **(f30[10]);
-	int * const *(f31[]);
-	int * const *(f32[10]);
-	int * const * const (f33[]);
-	int * const * const (f34[10]);
-
-	int (*f35[]);
-	int (*f36[10]);
-	int (**f37[]);
-	int (**f38[10]);
-	int (* const *f39[]);
-	int (* const *f40[10]);
-	int (* const * const f41[]);
-	int (* const * const f42[10]);
-
-	int f43[][3];
-	int f44[3][3];
-	int (f45[])[3];
-	int (f46[3])[3];
-	int ((f47[]))[3];
-	int ((f48[3]))[3];
-
-	int *f49[][3];
-	int *f50[3][3];
-	int **f51[][3];
-	int **f52[3][3];
-	int * const *f53[][3];
-	int * const *f54[3][3];
-	int * const * const f55[][3];
-	int * const * const f56[3][3];
-
-	int (*f57[][3]);
-	int (*f58[3][3]);
-	int (**f59[][3]);
-	int (**f60[3][3]);
-	int (* const *f61[][3]);
-	int (* const *f62[3][3]);
-	int (* const * const f63[][3]);
-	int (* const * const f64[3][3]);
-
-	int f65(int);
-	int (f66)(int);
-
-	int *f67(int);
-	int **f68(int);
-	int * const *f69(int);
-	int * const * const f70(int);
-
-	int *(f71)(int);
-	int **(f72)(int);
-	int * const *(f73)(int);
-	int * const * const (f74)(int);
-
-	int (*f75)(int);
-	int (**f76)(int);
-	int (* const *f77)(int);
-	int (* const * const f78)(int);
-
-	int (*(*f79)(int))();
-	int (*(* const f80)(int))();
-	int (* const(* const f81)(int))();
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// End: //
Index: sts/userLiterals.cfa
===================================================================
--- tests/userLiterals.cfa	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,93 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// user_literals.cfa --
-//
-// Author           : Peter A. Buhr
-// Created On       : Wed Sep  6 21:40:50 2017
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Dec  4 22:03:10 2018
-// Update Count     : 56
-//
-
-#include <fstream.hfa>
-#include <wchar.h>
-#include <uchar.h>
-
-int ?`s( int s ) { sout | "secs" | s; return s; }
-int ?`m( int m ) { sout | "mins" | m; return m * 60; }
-int ?`h( int h ) { sout | "hours" | h; return h * 3600; }
-int ?`_A_( int x ) { sout | "_A_" | x; return x; }
-int ?`__thingy_( int x ) { sout | "_thingy_" | x; return x; }
-
-int ?`s( const char * s ) { sout | "secs" | s; return 0; }
-int ?`m( const char16_t * m ) { sout | "mins" | m; return 0;}
-int ?`h( const char32_t * h ) { sout | "hours" | h; return 0; }
-int ?`_A_( const wchar_t * str ) { sout | "_A_" | str; return 0; }
-int ?`__thingy_( const char * str ) { sout | "_thingy_" | str; return 0; }
-
-
-struct Weight { double stones; };
-void ?{}( Weight & w ) { w.stones = 0; }
-void ?{}( Weight & w, double w ) { w.stones = w; }
-Weight ?+?( Weight l, Weight r ) {
-	return (Weight){ l.stones + r.stones };
-}
-ofstream & ?|?( ofstream & os, Weight w ) { return os | w.stones; }
-
-Weight ?`st( double w ) { return (Weight){ w }; }		// backquote for user literals
-Weight ?`lb( double w ) { return (Weight){ w / 14.0 }; }
-Weight ?`kg( double w ) { return (Weight) { w * 0.16 }; }
-
-int main() {
-	Weight w, heavy = { 20 };							// 20 stone
-	w = 155`lb;
-	sout | w;
-	w = 0b_1111`st;
-	sout | w;
-	w = 0_233`lb;										// octal weight (155)
-	sout | w;
-	w = 0x_9b_u`kg;
-	sout | w;
-	w = 70.3`kg;
-	sout | w;
-	w = 11`st + 1`lb;
-	sout | w;
-	w = 5`st + 8`kg + 25`lb + heavy;
-	sout | w;
-
-//	0`secs;
-	1`s;
-	23`s;
-	23u`m;
-	23l`h;
-	23_ul`_A_;
-	1_234_LL`__thingy_;
-
-	0xff_ffl;
-	0xff_ff`s;
-	0xff_ffu`m;
-	0xff_ffl`h;
-	0xff_fful`_A_;
-	0xff_ffLL`__thingy_;
-
-	'\n'`s;
-	L'\n'`h;
-	u'\n'`m;
-	L_'\n'`_A_;
-	U_'\n'`__thingy_;
-
-	"abc"`s;
-//	u"abc"`m;
-//	U_"abc"`h;
-//	L"abc"`_A_;
-	u8_"abc"`__thingy_;
-} // main
-
-// Local Variables: //
-// tab-width: 4 //
-// compile-command: "cfa user_literals.cfa" //
-// End: //
Index: sts/virtualCast.cfa
===================================================================
--- tests/virtualCast.cfa	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,76 +1,0 @@
-// Testing the virtual cast, as part of strict inheritance.
-
-/* IMPORTANT: This test does not repersent the final feature set.
- * We are missing a number of important aspects such as:
- * + vtable type generation.
- * + vtable instance generation, that might use different resolution rules.
- * + Virtual syntax to force said generation on structures and traits.
- * + Trait references/pointers that do the virtual_table lookup.
- */
-
-#include <stdlib.hfa>
-#include <assert.h>
-
-struct alpha_vtable {
-	alpha_vtable const * const parent;
-	char (*code)(void);
-};
-
-struct alpha {
-	alpha_vtable const * virtual_table;
-};
-
-char ret_a(void) {
-	return 'a';
-}
-
-
-
-struct beta_vtable {
-	alpha_vtable const * const parent;
-	char (*code)(void);
-};
-
-struct beta {
-	beta_vtable const * virtual_table;
-};
-
-char ret_b(void) {
-	return 'b';
-}
-
-
-
-struct gamma_vtable {
-	beta_vtable const * const parent;
-	char (*code)(void);
-};
-
-struct gamma {
-	gamma_vtable const * virtual_table;
-};
-
-char ret_g(void) {
-	return 'g';
-}
-
-
-extern "C" {
-	alpha_vtable _alpha_vtable_instance = { 0, ret_a };
-	beta_vtable _beta_vtable_instance = { &_alpha_vtable_instance, ret_b };
-	gamma_vtable _gamma_vtable_instance = { &_beta_vtable_instance, ret_g };
-}
-
-int main (int argc, char * argv[]) {
-
-	gamma * tri = malloc(); tri->virtual_table = &_gamma_vtable_instance;
-	beta * mid = (virtual beta *)tri;
-	assert( 'g' == mid->virtual_table->code() );
-
-	alpha * top = malloc(); top->virtual_table = &_alpha_vtable_instance;
-	mid = (virtual beta *)top;
-	assert( ! mid );
-
-	free(tri);
-	free(top);
-}
Index: sts/withStatement.cfa
===================================================================
--- tests/withStatement.cfa	(revision 8abca0660e7023ad48db341fe98ce11969bb2e8a)
+++ 	(revision )
@@ -1,109 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// tupleFunction.c --
-//
-// Author           : Rob Schluntz
-// Created On       : Mon Dec 04 17:41:45 2017
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Dec 24 19:08:18 2018
-// Update Count     : 5
-//
-
-#include <fstream.hfa>
-
-struct S {
-	int i;
-	// dynamically allocated member ensures ctor/dtors are called correctly on temporaries
-	int * ptr;
-};
-
-// with clause on reference parameter
-void ?{}( S & this, int n ) with( this ) {
-	i = n;
-	ptr = (int *)malloc( sizeof(int) );
-}
-
-void ?{}( S & this ) {
-	this{ 0 };
-}
-
-void ?{}( S & this, S other ) {
-	this{ other.i };
-}
-
-S ?=?( S & this, S other ) with( this ) {
-	i = other.i;
-	*ptr = *other.ptr;
-	return this;
-}
-
-void ^?{}( S & this ) with( this ) {
-	free( ptr );
-}
-
-struct S2 {
-	S s;
-};
-
-void ?{}( S2 & this, int n ) {
-	(this.s){ n };
-}
-
-forall( otype T )
-struct Box {
-	T x;
-};
-
-forall( otype T )
-void ?{}( Box(T) & this ) with( this ) { // with clause in polymorphic function
-	x{};
-}
-
-void print( int i ) { sout | i; }
-
-forall( otype T | { void print( T ); })
-void foo( T t ) {
-	Box( T ) b = { t };
-	with( b ) {  // with statement in polymorphic function
-		print( x );
-	}
-}
-
-// ensure with-statement temporary generation works correctly
-S mk() {
-	sout | "called mk";
-	return (S){ 444 };
-}
-
-// ensure with-statement temporary generation with reference-returning functions works correctly
-S & ref() {
-	static S var = { 123456789 };
-	return var;
-}
-
-int main() {
-	S2 s2 = { 12345 };
-	with ( s2) {
-		with( s ) { // with s2.s
-			sout | i | s.i | s2.s.i;
-			foo( i );  // s.i
-			with( mk()) {
-				sout | i | i | i;
-				with( ref()) {
-					sout | i | i | i;
-				} // with ref()
-				with( ref()) {
-					sout | i | i | i;
-				} // with ref()
-			} // with mk()
-		} // with s
-	} // with s2
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// End: //
Index: tests/zombies/abort.cfa
===================================================================
--- tests/zombies/abort.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/zombies/abort.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,18 @@
+#include <stdlib.h>
+
+int level3() {
+	abort();
+	return 0;
+}
+
+int level2() {
+	return level3();
+}
+
+int level1() {
+	return level2();
+}
+
+int main() {
+	return level1();
+}
Index: tests/zombies/context.cfa
===================================================================
--- tests/zombies/context.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/zombies/context.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,19 @@
+// trait declaration
+
+trait has_q( otype T ) {
+	T q( T );
+};
+
+forall( otype z | has_q( z ) ) void f() {
+	trait has_r( otype T, otype U ) {
+		T r( T, T (T,U) );
+	};
+
+	extern otype x, y | has_r( x, y );
+}
+
+//Dummy main
+int main(int argc, char const *argv[])
+{
+	return 0;
+}
Index: tests/zombies/namedParmArg.cfa
===================================================================
--- tests/zombies/namedParmArg.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/zombies/namedParmArg.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,14 @@
+int f1( int i = 3, int *j = 0 ) {}  /* ANSI */
+[int, int ] f2( int i = 3, * int j = 0 ) {}  /* CFA */
+
+int main() {
+    f1();		/* identical calls */
+    f1( 3 );
+    f1( 3, );
+    f1( 3, 0 );
+    f1( 3, j : 0 );
+    f1( j : 0, 3 );
+    f1( i : 3, j : 0 );
+    f1( j : 0, i : 3 );
+    f1( [j, i] : f2() );
+}
Index: tests/zombies/occursError.cfa
===================================================================
--- tests/zombies/occursError.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/zombies/occursError.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,12 @@
+forall( otype T ) void f( void (*)( T, T * ) );
+forall( otype U ) void g( U,  U * );
+forall( otype U ) void h( U *, U );
+
+void test() {
+    f( h );
+    f( g );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: tests/zombies/scope.cfa
===================================================================
--- tests/zombies/scope.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/zombies/scope.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,73 @@
+int x;
+typedef double y;
+typedef float t;
+y z;
+//otype u = struct { int a; double b; };
+typedef struct { int a; double b; } u;
+int f( int y );
+y q;
+struct x { int x; };
+
+y w( y y, u v ) {
+//	otype x | { x t(u); };
+	void ?{}(struct x *);
+	void ^?{}(struct x *);
+	extern struct x t( u );
+	u u = y;
+	struct x z = t(u);
+}
+
+y p;
+
+trait has_u( otype z ) {
+	z u(z);
+};
+
+forall( otype t | has_u( t ) )
+y q( t the_t ) {
+	t y = u( the_t );
+}
+
+t f( y p ) {
+	int y;
+	typedef char x;
+	{
+		x y;
+		typedef x z;
+		{
+			z x;
+			typedef z y;
+			y z = x;
+		}
+		z x = y;
+	}
+	x q = y;
+}
+
+void some_func() {}
+
+t g( void ) {
+	typedef char x;
+//	try {
+		some_func();
+//	} catch ( x x ) {
+//		t y = x;
+//	}
+	x z;
+}
+
+y q( i )												/* K&R style */
+	int i;
+{
+	switch ( i ) {
+		y q = i;
+	  case 0:
+		return q;
+	  default:
+		return i;
+	}
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: tests/zombies/structMember.cfa
===================================================================
--- tests/zombies/structMember.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/zombies/structMember.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,100 @@
+typedef int TD;
+extern struct TTT {};
+
+struct S {
+	int m1:3, m2:4;
+	int :2;
+	int :3, :4;
+	int m3;
+	int m4, m5, m6;
+	int *m7, *m8, *m9;
+	__extension__ int (*m10)();
+	__extension__ int *(*m11)(int);
+//	TD (TD);
+
+// Cforall declarations
+
+	* int m12, m13;
+	* [ * int ] (int) m14;
+
+// C anonymous declarations (padding)
+
+	int :4;
+	int :4, :6;
+
+// Cforall anonymous declarations (padding)
+
+	int @;
+	TD @;
+	int @, @, @;
+	int * @ , @, @;
+	int * @, * @, * @;
+	* int @, @, @;
+	struct TTT @;
+	TTT @, @;
+	int @ :4, @ :6;
+	* int @, @;
+	int (*@)();
+	int (*@)(int), (*@)(int);
+	* [int](int) @, @;
+	int (**@)( int );
+	* * [int](int) @;
+
+// C aggregate open declarations
+
+	__extension__ union { int i; };
+	struct T { int k; };
+
+// Cforall forward declaration
+
+	struct PPP;
+	__extension__ struct QQQ;
+
+// C useless declarations
+
+	int;
+	TD;
+	unsigned int;
+	__extension__ long double;
+	_Complex;
+	double _Complex;
+	volatile zero_t;
+	const one_t;
+	S;
+	.S;
+	S.T;
+	.S.T;
+	forall( otype S, otype T ) struct W {
+		struct X {};
+	};
+	W(int);
+	W(int).X;
+};
+
+struct S s;
+
+// Cforall Plan 9 declarations
+
+struct UUU {};
+extern struct SSS {
+	inline struct WWW {};
+	inline UUU;
+	inline UUU *, **;
+	inline UUU (*)( int p );
+	inline int;
+	inline int *;
+	inline * int;
+	inline int (*)( int p );
+	inline * [int](int p);
+};
+
+union U {
+	[5] int m1;
+	int m2[5];
+	* int m3;
+	int *m4;
+} u;
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: tests/zombies/subrange.cfa
===================================================================
--- tests/zombies/subrange.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/zombies/subrange.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,63 @@
+// A small context defining the notion of an ordered otype.  (The standard
+// library should probably contain a context for this purpose.)
+trait ordered(otype T) {
+    int ?<?(T, T), ?<=?(T, T);
+};
+
+// A subrange otype resembling an Ada subotype with a base otype and a range
+// constraint.
+otype subrange(otype base_t | ordered(base_t), base_t low = 0, base_t high = 8) = base_t;
+
+// Note that subrange() can be applied to floating-point and pointer otypes, not
+// just integral otypes.
+//   This requires a "otype generator" extension to Cforall.  Type generators
+// must accept otype and non-otype parameters, which is beyond what we discussed
+// previously.  Type parameters must be usable in the declaration of
+// subsequent parameters: parameter T is used to declare parameters "low"
+// and "high".
+
+// Example usage:
+subrange(unsigned, 1, 31) day_of_month;
+subrange(char, 'a', 'z')  lcase;
+subrange(int, 0, (rand() & 0xF) ) foo;
+
+// What sorts of expressions can be used as arguments of otype generators?  Is
+// "subrange(int, 0, rand() & 0xF)" legal?  Probably.  The nearest C equivalent
+// to the "low" and "high" arguments is the array size in a variable-length
+// array declaration, and C allows assignment expressions there.
+
+// Convenient access to subrange bounds, for instance for iteration:
+forall (otype T, T low, T high)
+T lbound( subrange(T, low, high) v) {
+    return low;
+}
+
+forall (otype T, T low, T high)
+T hbound( subrange(T, low, high) v) {
+    return high;
+}
+
+// Example usage:
+unsigned lday = lbound(day_of_month);
+
+// Assignment from the base otype, with bounds checking.  I'll ignore the issue
+// of exception handling here.  Inlining allows the compiler to eliminate
+// bounds checks.
+forall (otype T | ordered(T), T low, T high)
+inline subrange(T, low, high) ?=?(subrange(T, low, high)* target, T source) {
+    if (low <= source && source <= high) *((T*)target) = source;
+    else abort();
+    return target;
+}
+
+// Assignment between subranges with a common base otype.  The bounds check
+// compares range bounds so that the compiler can optimize checks away when the
+// ranges are known to overlap.
+forall (otype T | ordered(T), T t_low, T t_high, T s_low, T s_high)
+inline subrange(T, t_low, t_high) ?=?(subrange(T, t_low, t_high)* target,
+				      subrange(T, s_low, s_high) source) {
+    if ( (t_low <= s_low || t_low <= source)
+	 && (s_high <= t_high || source <= t_high) ) *((T*)target) = source;
+    else abort();
+    return target;
+}
Index: tests/zombies/typeGenerator.cfa
===================================================================
--- tests/zombies/typeGenerator.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/zombies/typeGenerator.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,30 @@
+context addable( otype T ) {
+	T ?+?( T,T );
+	T ?=?( T*, T);
+};
+
+otype List1( otype T | addable( T ) ) = struct { T data; List1( T ) *next; } *;
+typedef List1( int ) ListOfIntegers;
+//List1( int ) li;
+ListOfIntegers li;
+int f( List1( int ) ( (*g ))( int ) );
+[int] h( * List1( int ) p );							// new declaration syntax
+
+struct( otype T ) S2 { T i; };							// actual definition
+struct( int ) S3 v1, *p;								// expansion and instantiation
+struct( otype T )( int ) S24 { T i; } v2;				// actual definition, expansion and instantiation
+struct( otype T )( int ) { T i; } v2;					// anonymous actual definition, expansion and instantiation
+
+struct( otype T | addable( T ) ) node { T data; struct( T ) node *next; };
+otype List( otype T ) = struct( T ) node *;
+List( int ) my_list;
+
+otype Complex | addable( Complex );
+
+int main() {
+	(struct( int ) node)my_list;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: tests/zombies/typedef.cfa
===================================================================
--- tests/zombies/typedef.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/zombies/typedef.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,47 @@
+typedef int T;
+
+void f( void ) {
+    int T( T p ) { return 3; }
+    T( 3 );
+}
+
+struct {
+    T (T);
+} fred = { 3 };
+
+typedef int (*a)(int, char);
+a b;
+
+int g(void) {
+    double a;
+}
+a c;
+
+typedef typeof(3) x, y;  // GCC
+
+x p;
+y q;
+
+int main() {
+    typedef typeof(3) z, p;
+    z w;
+    p x;
+}
+
+// new-style function definitions
+
+typedef [10] * int arrayOf10Pointers;
+arrayOf10Pointers array;
+typedef const * int constantPointer;
+typedef * [ int ]( [] int ) funcPtr;
+typedef [ int ] funcProto( []  int );
+typedef [ int, int ] tupleType;
+typedef * [ int, int ] tupleTypePtr;
+typedef * int c, d;
+typedef [ int ] f( * int ), g;
+typedef [ * [static 10] int ] t;
+typedef [ * [static 10] int x ] h();
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: tests/zombies/typedefDeclarator.cfa
===================================================================
--- tests/zombies/typedefDeclarator.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/zombies/typedefDeclarator.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,120 @@
+typedef int
+	 f0,  f1,  f2,  f3,  f4,  f5,  f6,  f7,  f8,  f9,
+	f10, f11, f12, f13, f14, f15, f16, f17, f18, f19,
+	f20, f21, f22, f23, f24, f25, f26, f27, f28, f29,
+	f30, f31, f32, f33, f34, f35, f36, f37, f38, f39,
+	f40, f41, f42, f43, f44, f45, f46, f47, f48, f49,
+	f50, f51, f52, f53, f54, f55, f56, f57, f58, f59,
+	f60, f61, f62, f63, f64, f65, f66, f67, f68, f69,
+	f70, f71, f72, f73, f74, f75, f76, f77, f78, f79,
+	f80, f81, f82, f83, f84, f85, f86, f87, f88, f89;
+
+int main() {
+	//int f0[]();
+	//int (f0[])();
+	//int f0()[];
+	//int f0()();
+	//int (*f0)()();
+	//int ((*f0())())[];
+	
+	int f1;
+	int (f2);
+
+	int *f3;
+	int **f4;
+	int * const *f5;
+	int * const * const f6;
+
+	int *(f7);
+	int **(f8);
+	int * const *(f9);
+	int * const * const (f10);
+
+	int (*f11);
+	int (**f12);
+	int (* const *f13);
+	int (* const * const f14);
+
+	int f15[];
+	int f16[10];
+	int (f17[]);
+	int (f18[10]);
+
+	int *f19[];
+	int *f20[10];
+	int **f21[];
+	int **f22[10];
+	int * const *f23[];
+	int * const *f24[10];
+	int * const * const f25[];
+	int * const * const f26[10];
+
+	int *(f27[]);
+	int *(f28[10]);
+	int **(f29[]);
+	int **(f30[10]);
+	int * const *(f31[]);
+	int * const *(f32[10]);
+	int * const * const (f33[]);
+	int * const * const (f34[10]);
+
+	int (*f35[]);
+	int (*f36[10]);
+	int (**f37[]);
+	int (**f38[10]);
+	int (* const *f39[]);
+	int (* const *f40[10]);
+	int (* const * const f41[]);
+	int (* const * const f42[10]);
+
+	int f43[][3];
+	int f44[3][3];
+	int (f45[])[3];
+	int (f46[3])[3];
+	int ((f47[]))[3];
+	int ((f48[3]))[3];
+
+	int *f49[][3];
+	int *f50[3][3];
+	int **f51[][3];
+	int **f52[3][3];
+	int * const *f53[][3];
+	int * const *f54[3][3];
+	int * const * const f55[][3];
+	int * const * const f56[3][3];
+
+	int (*f57[][3]);
+	int (*f58[3][3]);
+	int (**f59[][3]);
+	int (**f60[3][3]);
+	int (* const *f61[][3]);
+	int (* const *f62[3][3]);
+	int (* const * const f63[][3]);
+	int (* const * const f64[3][3]);
+
+	int f65(int);
+	int (f66)(int);
+
+	int *f67(int);
+	int **f68(int);
+	int * const *f69(int);
+	int * const * const f70(int);
+
+	int *(f71)(int);
+	int **(f72)(int);
+	int * const *(f73)(int);
+	int * const * const (f74)(int);
+
+	int (*f75)(int);
+	int (**f76)(int);
+	int (* const *f77)(int);
+	int (* const * const f78)(int);
+
+	int (*(*f79)(int))();
+	int (*(* const f80)(int))();
+	int (* const(* const f81)(int))();
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: tests/zombies/userLiterals.cfa
===================================================================
--- tests/zombies/userLiterals.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/zombies/userLiterals.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,93 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// user_literals.cfa --
+//
+// Author           : Peter A. Buhr
+// Created On       : Wed Sep  6 21:40:50 2017
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue Dec  4 22:03:10 2018
+// Update Count     : 56
+//
+
+#include <fstream.hfa>
+#include <wchar.h>
+#include <uchar.h>
+
+int ?`s( int s ) { sout | "secs" | s; return s; }
+int ?`m( int m ) { sout | "mins" | m; return m * 60; }
+int ?`h( int h ) { sout | "hours" | h; return h * 3600; }
+int ?`_A_( int x ) { sout | "_A_" | x; return x; }
+int ?`__thingy_( int x ) { sout | "_thingy_" | x; return x; }
+
+int ?`s( const char * s ) { sout | "secs" | s; return 0; }
+int ?`m( const char16_t * m ) { sout | "mins" | m; return 0;}
+int ?`h( const char32_t * h ) { sout | "hours" | h; return 0; }
+int ?`_A_( const wchar_t * str ) { sout | "_A_" | str; return 0; }
+int ?`__thingy_( const char * str ) { sout | "_thingy_" | str; return 0; }
+
+
+struct Weight { double stones; };
+void ?{}( Weight & w ) { w.stones = 0; }
+void ?{}( Weight & w, double w ) { w.stones = w; }
+Weight ?+?( Weight l, Weight r ) {
+	return (Weight){ l.stones + r.stones };
+}
+ofstream & ?|?( ofstream & os, Weight w ) { return os | w.stones; }
+
+Weight ?`st( double w ) { return (Weight){ w }; }		// backquote for user literals
+Weight ?`lb( double w ) { return (Weight){ w / 14.0 }; }
+Weight ?`kg( double w ) { return (Weight) { w * 0.16 }; }
+
+int main() {
+	Weight w, heavy = { 20 };							// 20 stone
+	w = 155`lb;
+	sout | w;
+	w = 0b_1111`st;
+	sout | w;
+	w = 0_233`lb;										// octal weight (155)
+	sout | w;
+	w = 0x_9b_u`kg;
+	sout | w;
+	w = 70.3`kg;
+	sout | w;
+	w = 11`st + 1`lb;
+	sout | w;
+	w = 5`st + 8`kg + 25`lb + heavy;
+	sout | w;
+
+//	0`secs;
+	1`s;
+	23`s;
+	23u`m;
+	23l`h;
+	23_ul`_A_;
+	1_234_LL`__thingy_;
+
+	0xff_ffl;
+	0xff_ff`s;
+	0xff_ffu`m;
+	0xff_ffl`h;
+	0xff_fful`_A_;
+	0xff_ffLL`__thingy_;
+
+	'\n'`s;
+	L'\n'`h;
+	u'\n'`m;
+	L_'\n'`_A_;
+	U_'\n'`__thingy_;
+
+	"abc"`s;
+//	u"abc"`m;
+//	U_"abc"`h;
+//	L"abc"`_A_;
+	u8_"abc"`__thingy_;
+} // main
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa user_literals.cfa" //
+// End: //
Index: tests/zombies/virtualCast.cfa
===================================================================
--- tests/zombies/virtualCast.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/zombies/virtualCast.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,76 @@
+// Testing the virtual cast, as part of strict inheritance.
+
+/* IMPORTANT: This test does not repersent the final feature set.
+ * We are missing a number of important aspects such as:
+ * + vtable type generation.
+ * + vtable instance generation, that might use different resolution rules.
+ * + Virtual syntax to force said generation on structures and traits.
+ * + Trait references/pointers that do the virtual_table lookup.
+ */
+
+#include <stdlib.hfa>
+#include <assert.h>
+
+struct alpha_vtable {
+	alpha_vtable const * const parent;
+	char (*code)(void);
+};
+
+struct alpha {
+	alpha_vtable const * virtual_table;
+};
+
+char ret_a(void) {
+	return 'a';
+}
+
+
+
+struct beta_vtable {
+	alpha_vtable const * const parent;
+	char (*code)(void);
+};
+
+struct beta {
+	beta_vtable const * virtual_table;
+};
+
+char ret_b(void) {
+	return 'b';
+}
+
+
+
+struct gamma_vtable {
+	beta_vtable const * const parent;
+	char (*code)(void);
+};
+
+struct gamma {
+	gamma_vtable const * virtual_table;
+};
+
+char ret_g(void) {
+	return 'g';
+}
+
+
+extern "C" {
+	alpha_vtable _alpha_vtable_instance = { 0, ret_a };
+	beta_vtable _beta_vtable_instance = { &_alpha_vtable_instance, ret_b };
+	gamma_vtable _gamma_vtable_instance = { &_beta_vtable_instance, ret_g };
+}
+
+int main (int argc, char * argv[]) {
+
+	gamma * tri = malloc(); tri->virtual_table = &_gamma_vtable_instance;
+	beta * mid = (virtual beta *)tri;
+	assert( 'g' == mid->virtual_table->code() );
+
+	alpha * top = malloc(); top->virtual_table = &_alpha_vtable_instance;
+	mid = (virtual beta *)top;
+	assert( ! mid );
+
+	free(tri);
+	free(top);
+}
Index: tests/zombies/withStatement.cfa
===================================================================
--- tests/zombies/withStatement.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ tests/zombies/withStatement.cfa	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
@@ -0,0 +1,109 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// tupleFunction.c --
+//
+// Author           : Rob Schluntz
+// Created On       : Mon Dec 04 17:41:45 2017
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Dec 24 19:08:18 2018
+// Update Count     : 5
+//
+
+#include <fstream.hfa>
+
+struct S {
+	int i;
+	// dynamically allocated member ensures ctor/dtors are called correctly on temporaries
+	int * ptr;
+};
+
+// with clause on reference parameter
+void ?{}( S & this, int n ) with( this ) {
+	i = n;
+	ptr = (int *)malloc( sizeof(int) );
+}
+
+void ?{}( S & this ) {
+	this{ 0 };
+}
+
+void ?{}( S & this, S other ) {
+	this{ other.i };
+}
+
+S ?=?( S & this, S other ) with( this ) {
+	i = other.i;
+	*ptr = *other.ptr;
+	return this;
+}
+
+void ^?{}( S & this ) with( this ) {
+	free( ptr );
+}
+
+struct S2 {
+	S s;
+};
+
+void ?{}( S2 & this, int n ) {
+	(this.s){ n };
+}
+
+forall( otype T )
+struct Box {
+	T x;
+};
+
+forall( otype T )
+void ?{}( Box(T) & this ) with( this ) { // with clause in polymorphic function
+	x{};
+}
+
+void print( int i ) { sout | i; }
+
+forall( otype T | { void print( T ); })
+void foo( T t ) {
+	Box( T ) b = { t };
+	with( b ) {  // with statement in polymorphic function
+		print( x );
+	}
+}
+
+// ensure with-statement temporary generation works correctly
+S mk() {
+	sout | "called mk";
+	return (S){ 444 };
+}
+
+// ensure with-statement temporary generation with reference-returning functions works correctly
+S & ref() {
+	static S var = { 123456789 };
+	return var;
+}
+
+int main() {
+	S2 s2 = { 12345 };
+	with ( s2) {
+		with( s ) { // with s2.s
+			sout | i | s.i | s2.s.i;
+			foo( i );  // s.i
+			with( mk()) {
+				sout | i | i | i;
+				with( ref()) {
+					sout | i | i | i;
+				} // with ref()
+				with( ref()) {
+					sout | i | i | i;
+				} // with ref()
+			} // with mk()
+		} // with s
+	} // with s2
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
