Index: src/tests/.expect/nested-types-ERR1.txt
===================================================================
--- src/tests/.expect/nested-types-ERR1.txt	(revision 0bcc2b72f5a3e94a3801264eec1b2ad84ce633d6)
+++ src/tests/.expect/nested-types-ERR1.txt	(revision 0bcc2b72f5a3e94a3801264eec1b2ad84ce633d6)
@@ -0,0 +1,1 @@
+nested-types.c:70:1 error: Use of undefined type T
Index: src/tests/.expect/nested-types-ERR2.txt
===================================================================
--- src/tests/.expect/nested-types-ERR2.txt	(revision 0bcc2b72f5a3e94a3801264eec1b2ad84ce633d6)
+++ src/tests/.expect/nested-types-ERR2.txt	(revision 0bcc2b72f5a3e94a3801264eec1b2ad84ce633d6)
@@ -0,0 +1,6 @@
+nested-types.c:73:1 error: Use of undefined global type Z
+nested-types.c:74:1 error: Qualified type requires an aggregate on the left, but has: signed int
+nested-types.c:75:1 error: Undefined type in qualified type: Qualified Type: 
+  instance of struct S with body 1 
+  instance of type Z (not function type) 
+
Index: src/tests/Makefile.am
===================================================================
--- src/tests/Makefile.am	(revision c0cc5da47525166888123de76bf115dc575ebf21)
+++ src/tests/Makefile.am	(revision 0bcc2b72f5a3e94a3801264eec1b2ad84ce633d6)
@@ -110,4 +110,10 @@
 	${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
 
+nested-types-ERR1: nested-types.c @CFA_BINDIR@/@CFA_NAME@
+	${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
+
+nested-types-ERR2: nested-types.c @CFA_BINDIR@/@CFA_NAME@
+	${CC} ${AM_CFLAGS} ${CFLAGS} -DERR2 ${<} -o ${@}
+
 # Constructor/destructor tests
 raii/dtor-early-exit-ERR1: raii/dtor-early-exit.c @CFA_BINDIR@/@CFA_NAME@
Index: src/tests/Makefile.in
===================================================================
--- src/tests/Makefile.in	(revision c0cc5da47525166888123de76bf115dc575ebf21)
+++ src/tests/Makefile.in	(revision 0bcc2b72f5a3e94a3801264eec1b2ad84ce633d6)
@@ -787,4 +787,10 @@
 	${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
 
+nested-types-ERR1: nested-types.c @CFA_BINDIR@/@CFA_NAME@
+	${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
+
+nested-types-ERR2: nested-types.c @CFA_BINDIR@/@CFA_NAME@
+	${CC} ${AM_CFLAGS} ${CFLAGS} -DERR2 ${<} -o ${@}
+
 # Constructor/destructor tests
 raii/dtor-early-exit-ERR1: raii/dtor-early-exit.c @CFA_BINDIR@/@CFA_NAME@
Index: src/tests/nested-types.c
===================================================================
--- src/tests/nested-types.c	(revision 0bcc2b72f5a3e94a3801264eec1b2ad84ce633d6)
+++ src/tests/nested-types.c	(revision 0bcc2b72f5a3e94a3801264eec1b2ad84ce633d6)
@@ -0,0 +1,91 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// nested-types.c --
+//
+// Author           : Rob Schluntz
+// Created On       : Mon Jul 9 10:20:03 2018
+// Last Modified By : Rob Schluntz
+// Last Modified On : Mon Jul 9 10:20:03 2017
+// Update Count     : 1
+//
+
+typedef int N;
+struct A {
+  // forall(otype T) // xxx - should not be an error, but currently is
+  // struct N {
+  //   T x;
+  // };
+};
+
+struct S {
+  struct T {
+    int i;
+    typedef int Bar;
+  };
+  T x;
+
+  // struct U;
+  typedef T Bar;
+  typedef int Baz;
+};
+
+// // // // need a way to stuff a qualified name into a struct decl
+// // struct S.U {
+// //   double z;
+// // };
+
+// // what will this do?
+// struct U {
+//   union S {
+//     int i;
+//     double d;
+//   };
+// };
+
+// struct T {
+//   double d;
+// };
+
+int main() {
+  // access nested struct
+  S.T x;
+
+  {
+    struct S {
+      int i;
+      struct Z {
+        double d;
+      };
+    };
+
+    S.Z z;   // gets local S
+    .S.T y;  // lookup at global scope only
+
+    const volatile .S.T q;
+#if ERR1
+    T err1;           // error: no T in scope
+#endif
+#if ERR2
+    .Z err2;          // error: no Z in global scope
+    .S.Baz.Bar err3;  // error: .S.Baz => int, int is not aggregate and should not appear left of the dot
+    .S.Z err4;        // error: no Z in global S
+#endif
+  }
+
+  // U.S un;
+
+  S.Bar y;
+  S.Baz x;
+  S.T.Bar z;
+
+  // A.N(int) x;  // xxx - should not be an error, but currently is.
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa nested-types.c" //
+// End: //
