Index: src/ResolvExpr/AlternativeFinder.cc
===================================================================
--- src/ResolvExpr/AlternativeFinder.cc	(revision 6ed1d4b52317879c3ddb7e2d57c79ba619eed0c2)
+++ src/ResolvExpr/AlternativeFinder.cc	(revision 91b8a177877f60b6a4199f4198832bd8072b7374)
@@ -572,62 +572,70 @@
 
 		AltList candidates;
+		SemanticError errors;
 
 		for ( AltList::const_iterator func = funcFinder.alternatives.begin(); func != funcFinder.alternatives.end(); ++func ) {
-			PRINT(
-				std::cerr << "working on alternative: " << std::endl;
-				func->print( std::cerr, 8 );
-			)
-			// check if the type is pointer to function
-			PointerType *pointer;
-			if ( func->expr->get_results().size() == 1 && ( pointer = dynamic_cast< PointerType* >( func->expr->get_results().front() ) ) ) {
-				if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ) ) {
-					for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
-						// XXX
-						//Designators::check_alternative( function, *actualAlt );
-						makeFunctionAlternatives( *func, function, *actualAlt, std::back_inserter( candidates ) );
-					}
-				} else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( pointer->get_base() ) ) {
-					EqvClass eqvClass;
-					if ( func->env.lookup( typeInst->get_name(), eqvClass ) && eqvClass.type ) {
-						if ( FunctionType *function = dynamic_cast< FunctionType* >( eqvClass.type ) ) {
-							for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
-								makeFunctionAlternatives( *func, function, *actualAlt, std::back_inserter( candidates ) );
-							} // for
+			try {
+				PRINT(
+					std::cerr << "working on alternative: " << std::endl;
+					func->print( std::cerr, 8 );
+				)
+				// check if the type is pointer to function
+				PointerType *pointer;
+				if ( func->expr->get_results().size() == 1 && ( pointer = dynamic_cast< PointerType* >( func->expr->get_results().front() ) ) ) {
+					if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ) ) {
+						for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
+							// XXX
+							//Designators::check_alternative( function, *actualAlt );
+							makeFunctionAlternatives( *func, function, *actualAlt, std::back_inserter( candidates ) );
+						}
+					} else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( pointer->get_base() ) ) {
+						EqvClass eqvClass;
+						if ( func->env.lookup( typeInst->get_name(), eqvClass ) && eqvClass.type ) {
+							if ( FunctionType *function = dynamic_cast< FunctionType* >( eqvClass.type ) ) {
+								for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
+									makeFunctionAlternatives( *func, function, *actualAlt, std::back_inserter( candidates ) );
+								} // for
+							} // if
 						} // if
 					} // if
+				} else {
+					// seek a function operator that's compatible
+					if ( ! doneInit ) {
+						doneInit = true;
+						NameExpr *opExpr = new NameExpr( "?()" );
+						try {
+							funcOpFinder.findWithAdjustment( opExpr );
+						} catch( SemanticError &e ) {
+							// it's ok if there aren't any defined function ops
+						}
+						PRINT(
+							std::cerr << "known function ops:" << std::endl;
+							printAlts( funcOpFinder.alternatives, std::cerr, 8 );
+						)
+					}
+
+					for ( AltList::const_iterator funcOp = funcOpFinder.alternatives.begin(); funcOp != funcOpFinder.alternatives.end(); ++funcOp ) {
+						// check if the type is pointer to function
+						PointerType *pointer;
+						if ( funcOp->expr->get_results().size() == 1
+							&& ( pointer = dynamic_cast< PointerType* >( funcOp->expr->get_results().front() ) ) ) {
+							if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ) ) {
+								for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
+									AltList currentAlt;
+									currentAlt.push_back( *func );
+									currentAlt.insert( currentAlt.end(), actualAlt->begin(), actualAlt->end() );
+									makeFunctionAlternatives( *funcOp, function, currentAlt, std::back_inserter( candidates ) );
+								} // for
+							} // if
+						} // if
+					} // for
 				} // if
-			} else {
-				// seek a function operator that's compatible
-				if ( ! doneInit ) {
-					doneInit = true;
-					NameExpr *opExpr = new NameExpr( "?()" );
-					try {
-						funcOpFinder.findWithAdjustment( opExpr );
-					} catch( SemanticError &e ) {
-						// it's ok if there aren't any defined function ops
-					}
-					PRINT(
-						std::cerr << "known function ops:" << std::endl;
-						printAlts( funcOpFinder.alternatives, std::cerr, 8 );
-					)
-				}
-
-				for ( AltList::const_iterator funcOp = funcOpFinder.alternatives.begin(); funcOp != funcOpFinder.alternatives.end(); ++funcOp ) {
-					// check if the type is pointer to function
-					PointerType *pointer;
-					if ( funcOp->expr->get_results().size() == 1
-						 && ( pointer = dynamic_cast< PointerType* >( funcOp->expr->get_results().front() ) ) ) {
-						if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ) ) {
-							for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
-								AltList currentAlt;
-								currentAlt.push_back( *func );
-								currentAlt.insert( currentAlt.end(), actualAlt->begin(), actualAlt->end() );
-								makeFunctionAlternatives( *funcOp, function, currentAlt, std::back_inserter( candidates ) );
-							} // for
-						} // if
-					} // if
-				} // for
-			} // if
-		} // for
+			} catch ( SemanticError &e ) {
+				errors.append( e );
+			}
+		} // for
+
+		// Implement SFINAE; resolution errors are only errors if there aren't any non-erroneous resolutions
+		if ( candidates.empty() && ! errors.isEmpty() ) { throw errors; }
 
 		for ( AltList::iterator withFunc = candidates.begin(); withFunc != candidates.end(); ++withFunc ) {
