Index: src/ResolvExpr/AlternativeFinder.cc
===================================================================
--- src/ResolvExpr/AlternativeFinder.cc	(revision ae8b94256813adfe7582e0fabf10bdd0d8c7b864)
+++ src/ResolvExpr/AlternativeFinder.cc	(revision b10c9959109272e0304123be8aaefa37571499cf)
@@ -811,4 +811,27 @@
 	}
 
+	template< typename StructOrUnionType >
+	void AlternativeFinder::addOffsetof( StructOrUnionType *aggInst, const std::string &name ) {
+		std::list< Declaration* > members;
+		aggInst->lookup( name, members );
+		for ( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i ) {
+			if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType* >( *i ) ) {
+				alternatives.push_back( Alternative( new OffsetofExpr( aggInst->clone(), dwt->clone() ), env, Cost::zero ) );
+				renameTypes( alternatives.back().expr );
+			} else {
+				assert( false );
+			}
+		}
+	}
+	
+	void AlternativeFinder::visit( UntypedOffsetofExpr *offsetofExpr ) {
+		AlternativeFinder funcFinder( indexer, env );
+		if ( StructInstType *structInst = dynamic_cast< StructInstType* >( offsetofExpr->get_type() ) ) {
+			addOffsetof( structInst, offsetofExpr->get_member() );
+		} else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( offsetofExpr->get_type() ) ) {
+			addOffsetof( unionInst, offsetofExpr->get_member() );
+		}
+	}
+	
 	void AlternativeFinder::visit( OffsetofExpr *offsetofExpr ) {
 		alternatives.push_back( Alternative( offsetofExpr->clone(), env, Cost::zero ) );
Index: src/ResolvExpr/AlternativeFinder.h
===================================================================
--- src/ResolvExpr/AlternativeFinder.h	(revision ae8b94256813adfe7582e0fabf10bdd0d8c7b864)
+++ src/ResolvExpr/AlternativeFinder.h	(revision b10c9959109272e0304123be8aaefa37571499cf)
@@ -57,4 +57,5 @@
 		virtual void visit( SizeofExpr *sizeofExpr );
 		virtual void visit( AlignofExpr *alignofExpr );
+		virtual void visit( UntypedOffsetofExpr *offsetofExpr );
 		virtual void visit( OffsetofExpr *offsetofExpr );
 		virtual void visit( AttrExpr *attrExpr );
@@ -68,5 +69,8 @@
 
 	  private:
+		/// Adds alternatives for member expressions, given the aggregate, conversion cost for that aggregate, and name of the member
 		template< typename StructOrUnionType > void addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const std::string &name );
+		/// Adds alternatives for offsetof expressions, given the base type and name of the member
+		template< typename StructOrUnionType > void addOffsetof( StructOrUnionType *aggInst, const std::string &name );
 		bool instantiateFunction( std::list< DeclarationWithType* >& formals, /*const*/ AltList &actuals, bool isVarArgs, OpenVarSet& openVars, TypeEnvironment &resultEnv, AssertionSet &resultNeed, AssertionSet &resultHave );
 		template< typename OutputIterator >
