Index: src/Parser/DeclarationNode.cc
===================================================================
--- src/Parser/DeclarationNode.cc	(revision 9c751370b2fe743beb2ccb6ea3b17887d4b80942)
+++ src/Parser/DeclarationNode.cc	(revision d55d7a68246b165aeaa9e161109032ddd07146d8)
@@ -581,15 +581,15 @@
 					dst->basictype = src->basictype;
 				} else if ( src->basictype != DeclarationNode::NoBasicType )
-					throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::basicTypeNames[ src->basictype ] + " in type: ", src );
+					throw SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::basicTypeNames[ src->basictype ] + " in type: " );
 
 				if ( dst->complextype == DeclarationNode::NoComplexType ) {
 					dst->complextype = src->complextype;
 				} else if ( src->complextype != DeclarationNode::NoComplexType )
-					throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::complexTypeNames[ src->complextype ] + " in type: ", src );
+					throw SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::complexTypeNames[ src->complextype ] + " in type: " );
 
 				if ( dst->signedness == DeclarationNode::NoSignedness ) {
 					dst->signedness = src->signedness;
 				} else if ( src->signedness != DeclarationNode::NoSignedness )
-					throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::signednessNames[ src->signedness ] + " in type: ", src );
+					throw SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::signednessNames[ src->signedness ] + " in type: " );
 
 				if ( dst->length == DeclarationNode::NoLength ) {
@@ -598,5 +598,5 @@
 					dst->length = DeclarationNode::LongLong;
 				} else if ( src->length != DeclarationNode::NoLength )
-					throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::lengthNames[ src->length ] + " in type: ", src );
+					throw SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::lengthNames[ src->length ] + " in type: " );
 			} // if
 			break;
@@ -966,5 +966,4 @@
 			} // if
 		} catch( SemanticError &e ) {
-			e.set_location( cur->location );
 			errors.append( e );
 		} // try
@@ -1001,5 +1000,4 @@
 			} // if
 		} catch( SemanticError &e ) {
-			e.set_location( cur->location );
 			errors.append( e );
 		} // try
@@ -1020,5 +1018,4 @@
 			* out++ = cur->buildType();
 		} catch( SemanticError &e ) {
-			e.set_location( cur->location );
 			errors.append( e );
 		} // try
@@ -1032,5 +1029,5 @@
 
 Declaration * DeclarationNode::build() const {
-	if ( ! error.empty() ) throw SemanticError( error + " in declaration of ", this );
+	if ( ! error.empty() ) throw SemanticError( this, error + " in declaration of " );
 
 	if ( asmStmt ) {
@@ -1055,5 +1052,5 @@
 		//    inline _Noreturn int i;			// disallowed
 		if ( type->kind != TypeData::Function && funcSpecs.any() ) {
-			throw SemanticError( "invalid function specifier for ", this );
+			throw SemanticError( this, "invalid function specifier for " );
 		} // if
 		return buildDecl( type, name ? *name : string( "" ), storageClasses, maybeBuild< Expression >( bitfieldWidth ), funcSpecs, linkage, asmName, maybeBuild< Initializer >(initializer), attributes )->set_extension( extension );
@@ -1065,5 +1062,5 @@
 	//    inlne _Noreturn enum   E { ... };		// disallowed
 	if ( funcSpecs.any() ) {
-		throw SemanticError( "invalid function specifier for ", this );
+		throw SemanticError( this, "invalid function specifier for " );
 	} // if
 	assertf( name, "ObjectDecl must a have name\n" );
Index: src/Parser/ExpressionNode.cc
===================================================================
--- src/Parser/ExpressionNode.cc	(revision 9c751370b2fe743beb2ccb6ea3b17887d4b80942)
+++ src/Parser/ExpressionNode.cc	(revision d55d7a68246b165aeaa9e161109032ddd07146d8)
@@ -356,5 +356,5 @@
 
 Expression * build_field_name_FLOATING_FRACTIONconstant( const string & str ) {
-	if ( str.find_first_not_of( "0123456789", 1 ) != string::npos ) throw SemanticError( "invalid tuple index " + str );
+	if ( str.find_first_not_of( "0123456789", 1 ) != string::npos ) throw SemanticError( yylloc, "invalid tuple index " + str );
 	Expression * ret = build_constantInteger( *new string( str.substr(1) ) );
 	delete &str;
@@ -363,5 +363,5 @@
 
 Expression * build_field_name_FLOATING_DECIMALconstant( const string & str ) {
-	if ( str[str.size()-1] != '.' ) throw SemanticError( "invalid tuple index " + str );
+	if ( str[str.size()-1] != '.' ) throw SemanticError( yylloc, "invalid tuple index " + str );
 	Expression * ret = build_constantInteger( *new string( str.substr( 0, str.size()-1 ) ) );
 	delete &str;
Index: src/Parser/LinkageSpec.cc
===================================================================
--- src/Parser/LinkageSpec.cc	(revision 9c751370b2fe743beb2ccb6ea3b17887d4b80942)
+++ src/Parser/LinkageSpec.cc	(revision d55d7a68246b165aeaa9e161109032ddd07146d8)
@@ -24,5 +24,5 @@
 namespace LinkageSpec {
 
-Spec linkageCheck( const string * spec ) {
+Spec linkageCheck( CodeLocation location, const string * spec ) {
 	assert( spec );
 	unique_ptr<const string> guard( spec );	// allocated by lexer
@@ -34,9 +34,9 @@
 		return BuiltinC;
 	} else {
-		throw SemanticError( "Invalid linkage specifier " + *spec );
+		throw SemanticError( location, "Invalid linkage specifier " + *spec );
 	} // if
 }
 
-Spec linkageUpdate( Spec old_spec, const string * cmd ) {
+Spec linkageUpdate( CodeLocation location, Spec old_spec, const string * cmd ) {
 	assert( cmd );
 	unique_ptr<const string> guard( cmd ); // allocated by lexer
@@ -48,5 +48,5 @@
 		return old_spec;
 	} else {
-		throw SemanticError( "Invalid linkage specifier " + *cmd );
+		throw SemanticError( location, "Invalid linkage specifier " + *cmd );
 	} // if
 }
Index: src/Parser/LinkageSpec.h
===================================================================
--- src/Parser/LinkageSpec.h	(revision 9c751370b2fe743beb2ccb6ea3b17887d4b80942)
+++ src/Parser/LinkageSpec.h	(revision d55d7a68246b165aeaa9e161109032ddd07146d8)
@@ -17,4 +17,6 @@
 
 #include <string>
+
+#include "Common/CodeLocation.h"
 
 namespace LinkageSpec {
@@ -45,7 +47,7 @@
 
 
-	Spec linkageCheck( const std::string * );
+	Spec linkageCheck( CodeLocation location, const std::string * );
 	// Returns the Spec with the given name (limited to C, Cforall & BuiltinC)
-	Spec linkageUpdate( Spec old_spec, const std::string * cmd );
+	Spec linkageUpdate( CodeLocation location, Spec old_spec, const std::string * cmd );
 	/* If cmd = "C" returns a Spec that is old_spec with is_mangled = false
 	 * If cmd = "Cforall" returns old_spec Spec with is_mangled = true
Index: src/Parser/ParseNode.h
===================================================================
--- src/Parser/ParseNode.h	(revision 9c751370b2fe743beb2ccb6ea3b17887d4b80942)
+++ src/Parser/ParseNode.h	(revision d55d7a68246b165aeaa9e161109032ddd07146d8)
@@ -434,5 +434,4 @@
 			} // if
 		} catch( SemanticError &e ) {
-			e.set_location( cur->location );
 			errors.append( e );
 		} // try
Index: src/Parser/TypeData.cc
===================================================================
--- src/Parser/TypeData.cc	(revision 9c751370b2fe743beb2ccb6ea3b17887d4b80942)
+++ src/Parser/TypeData.cc	(revision d55d7a68246b165aeaa9e161109032ddd07146d8)
@@ -521,5 +521,5 @@
 
 static string genTSError( string msg, DeclarationNode::BasicType basictype ) {
-	throw SemanticError( string( "invalid type specifier \"" ) + msg + "\" for type \"" + DeclarationNode::basicTypeNames[basictype] + "\"." );
+	throw SemanticError( yylloc, string( "invalid type specifier \"" ) + msg + "\" for type \"" + DeclarationNode::basicTypeNames[basictype] + "\"." );
 } // genTSError
 
@@ -923,8 +923,8 @@
 				// type set => parameter name already transformed by a declaration names so there is a duplicate
 				// declaration name attempting a second transformation
-				if ( param->type ) throw SemanticError( string( "duplicate declaration name " ) + *param->name );
+				if ( param->type ) throw SemanticError( param->location, string( "duplicate declaration name " ) + *param->name );
 				// declaration type reset => declaration already transformed by a parameter name so there is a duplicate
 				// parameter name attempting a second transformation
-				if ( ! decl->type ) throw SemanticError( string( "duplicate parameter name " ) + *param->name );
+				if ( ! decl->type ) throw SemanticError( param->location, string( "duplicate parameter name " ) + *param->name );
 				param->type = decl->type;				// set copy declaration type to parameter type
 				decl->type = nullptr;					// reset declaration type
@@ -933,5 +933,5 @@
 		} // for
 		// declaration type still set => type not moved to a matching parameter so there is a missing parameter name
-		if ( decl->type ) throw SemanticError( string( "missing name in parameter list " ) + *decl->name );
+		if ( decl->type ) throw SemanticError( decl->location, string( "missing name in parameter list " ) + *decl->name );
 	} // for
 
Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision 9c751370b2fe743beb2ccb6ea3b17887d4b80942)
+++ src/Parser/parser.yy	(revision d55d7a68246b165aeaa9e161109032ddd07146d8)
@@ -482,7 +482,7 @@
 		{ $$ = new ExpressionNode( new StmtExpr( dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >($2) ) ) ); }
 	| type_name '.' no_attr_identifier					// CFA, nested type
-		{ throw SemanticError("Qualified names are currently unimplemented."); $$ = nullptr; } // FIX ME
+		{ throw SemanticError(yylloc, "Qualified names are currently unimplemented."); $$ = nullptr; } // FIX ME
 	| type_name '.' '[' push field_list pop ']'			// CFA, nested type / tuple field selector
-		{ throw SemanticError("Qualified names are currently unimplemented."); $$ = nullptr; } // FIX ME
+		{ throw SemanticError(yylloc, "Qualified names are currently unimplemented."); $$ = nullptr; } // FIX ME
 	;
 
@@ -1072,5 +1072,5 @@
 mutex_statement:
 	MUTEX '(' argument_expression_list ')' statement
-		{ throw SemanticError("Mutex statement is currently unimplemented."); $$ = nullptr; } // FIX ME
+		{ throw SemanticError(yylloc, "Mutex statement is currently unimplemented."); $$ = nullptr; } // FIX ME
 	;
 
@@ -1293,5 +1293,5 @@
 static_assert:
 	STATICASSERT '(' constant_expression ',' string_literal ')' ';' // C11
-		{ throw SemanticError("Static assert is currently unimplemented."); $$ = nullptr; }	// FIX ME
+		{ throw SemanticError(yylloc, "Static assert is currently unimplemented."); $$ = nullptr; }	// FIX ME
 
 // C declaration syntax is notoriously confusing and error prone. Cforall provides its own type, variable and function
@@ -2381,5 +2381,5 @@
 		{
 			linkageStack.push( linkage );				// handle nested extern "C"/"Cforall"
-			linkage = LinkageSpec::linkageUpdate( linkage, $2 );
+			linkage = LinkageSpec::linkageUpdate( yylloc, linkage, $2 );
 		}
 	  '{' external_definition_list_opt '}'
