diff --git tests/phpunit/tests/query/conditionals.php tests/phpunit/tests/query/conditionals.php
index 3c27388..3a6361e 100644
--- tests/phpunit/tests/query/conditionals.php
+++ tests/phpunit/tests/query/conditionals.php
@@ -138,6 +138,22 @@ class Tests_Query_Conditionals extends WP_UnitTestCase {
 		}
 	}
 
+	/**
+	 * @ticket 31935
+	 */
+	function test_page_feed_for_deleted_page() {
+		$page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'to-be-deleted-page' ) );
+		$url = get_permalink( $page_id );
+
+		// $url will now point to a deleted page
+		wp_delete_post( $page_id );
+
+		$this->go_to("{$url}feed/");
+
+		// make sure the correct wp_query flags are set
+		$this->assertQueryTrue('is_404', 'is_feed');
+	}
+
 	function test_page_feed_with_no_comments() {
 		$page_ids = array();
 		$page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'parent-page' ) );
