Index: src/SynTree/Visitor.h
===================================================================
--- src/SynTree/Visitor.h	(revision 7870799883ca946218c97fb6a189d1da90a16e8e)
+++ src/SynTree/Visitor.h	(revision 6f096d2341e25591a9d9435e4a28725954748a7a)
@@ -222,5 +222,5 @@
 
 template< typename TreeType, typename VisitorType >
-inline void maybeAccept( TreeType *tree, VisitorType &visitor ) {
+inline void maybeAccept( TreeType * tree, VisitorType & visitor ) {
 	if ( tree ) {
 		tree->accept( visitor );
@@ -228,11 +228,35 @@
 }
 
+template< typename TreeType, typename VisitorType >
+inline void maybeAccept( const TreeType * tree, VisitorType & visitor ) {
+	if ( tree ) {
+		tree->accept( visitor );
+	}
+}
+
 template< typename Container, typename VisitorType >
-inline void acceptAll( Container &container, VisitorType &visitor ) {
+inline void acceptAll( Container & container, VisitorType & visitor ) {
 	SemanticErrorException errors;
-	for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {
+	for ( const auto * i : container ) {
 		try {
-			if ( *i ) {
-				(*i)->accept( visitor );
+			if ( i ) {
+				i->accept( visitor );
+			}
+		} catch( SemanticErrorException & e ) {
+			errors.append( e );
+		}
+	}
+	if ( ! errors.isEmpty() ) {
+		throw errors;
+	}
+}
+
+template< typename Container, typename VisitorType >
+inline void acceptAll( const Container & container, VisitorType & visitor ) {
+	SemanticErrorException errors;
+	for ( const auto * i : container ) {
+		try {
+			if ( i ) {
+				i->accept( visitor );
 			}
 		} catch( SemanticErrorException &e ) {
