Index: src/AST/Util.cpp
===================================================================
--- src/AST/Util.cpp	(revision 14c0f7b320884dd43e70581e8f48fa7e2a8bc5c0)
+++ src/AST/Util.cpp	(revision efe420f3d0a297e0bd44a4e7abf93339a430606c)
@@ -104,4 +104,13 @@
 	}
 	assertf( false, "Member not found." );
+}
+
+template<typename node_t>
+void oneOfExprOrType( const node_t * node ) {
+	if ( node->expr ) {
+		assertf( node->expr && !node->type, "Exactly one of expr or type should be set." );
+	} else {
+		assertf( !node->expr && node->type, "Exactly one of expr or type should be set." );
+	}
 }
 
@@ -152,4 +161,14 @@
 	}
 
+	void previsit( const SizeofExpr * node ) {
+		previsit( (const ParseNode *)node );
+		oneOfExprOrType( node );
+	}
+
+	void previsit( const AlignofExpr * node ) {
+		previsit( (const ParseNode *)node );
+		oneOfExprOrType( node );
+	}
+
 	void previsit( const StructInstType * node ) {
 		previsit( (const Node *)node );
@@ -181,4 +200,6 @@
 /// referring to is in scope by the structural rules of code.
 // Any escapes marked with a bug should be removed once the bug is fixed.
+// This is a separate pass because of it changes the visit pattern and
+// must always be run on the entire translation unit.
 struct InScopeCore : public ast::WithShortCircuiting {
 	ScopedSet<DeclWithType const *> typedDecls;
