Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision f9941ff08adf6cc1d6d77e61ea910cc9f82ecbce)
+++ src/Parser/parser.yy	(revision 65d6de41c2c09d23085e6895805b2ec79ad9c1af)
@@ -10,6 +10,6 @@
 // Created On       : Sat Sep  1 20:22:55 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Oct 25 12:28:54 2017
-// Update Count     : 2893
+// Last Modified On : Fri Nov 17 11:38:57 2017
+// Update Count     : 2914
 //
 
@@ -348,9 +348,8 @@
 
 
-// Handle single shift/reduce conflict for dangling else by shifting the ELSE token. For example, this string
-// is ambiguous:
-// .---------.				matches IF '(' comma_expression ')' statement . (reduce)
-// if ( C ) S1 else S2
-// `-----------------'		matches IF '(' comma_expression ')' statement . (shift) ELSE statement */
+// Handle shift/reduce conflict for dangling else by shifting the ELSE token. For example, this string is ambiguous:
+//   .---------.				matches IF '(' comma_expression ')' statement . (reduce)
+//   if ( C ) S1 else S2
+//   `-----------------'		matches IF '(' comma_expression ')' statement . (shift) ELSE statement */
 // Similar issues exit with the waitfor statement.
 
@@ -361,4 +360,16 @@
 %precedence TIMEOUT	// token precedence for start of TIMEOUT in WAITFOR statement
 %precedence ELSE	// token precedence for start of else clause in IF/WAITFOR statement
+
+// Handle shift/reduce conflict for generic type by shifting the '(' token. For example, this string is ambiguous:
+//   forall( otype T ) struct Foo { T v; };
+//       .-----.				matches pointer to function returning a generic (which is impossible without a type)
+//   Foo ( *fp )( int );
+//   `---'						matches start of TYPEGENname '('
+// Must be:
+// Foo( int ) ( *fp )( int );
+
+// Order of these lines matters (low-to-high precedence).
+%precedence TYPEGENname
+%precedence '('
 
 %locations			// support location tracking for error messages
@@ -1765,5 +1776,7 @@
 
 typegen_name:											// CFA
-	TYPEGENname '(' ')'
+	TYPEGENname
+		{ $$ = DeclarationNode::newFromTypeGen( $1, nullptr ); }
+	| TYPEGENname '(' ')'
 		{ $$ = DeclarationNode::newFromTypeGen( $1, nullptr ); }
 	| TYPEGENname '(' type_list ')'
@@ -1809,5 +1822,13 @@
 		}
 	| aggregate_key attribute_list_opt typegen_name		// CFA
-		{ $$ = $3->addQualifiers( $2 ); }
+		{
+			// Create new generic declaration with same name as previous forward declaration, where the IDENTIFIER is
+			// switched to a TYPEGENname. Link any generic arguments from typegen_name to new generic declaration and
+			// delete newFromTypeGen.
+			$$ = DeclarationNode::newAggregate( $1, $3->type->symbolic.name, $3->type->symbolic.actuals, nullptr, false )->addQualifiers( $2 );
+			$3->type->symbolic.name = nullptr;
+			$3->type->symbolic.actuals = nullptr;
+			delete $3;
+		}
 	;
 
