Index: src/wp-includes/class-wp-comment-query.php
===================================================================
--- src/wp-includes/class-wp-comment-query.php	(revision 36409)
+++ src/wp-includes/class-wp-comment-query.php	(working copy)
@@ -757,7 +757,7 @@
 
 		// If any post-related query vars are passed, join the posts table.
 		$join_posts_table = false;
-		$plucked = wp_array_slice_assoc( $this->query_vars, array( 'post_author', 'post_name', 'post_parent', 'post_status', 'post_type' ) );
+		$plucked = wp_array_slice_assoc( $this->query_vars, array( 'post_author', 'post_name', 'post_parent' ) );
 		$post_fields = array_filter( $plucked );
 
 		if ( ! empty( $post_fields ) ) {
@@ -769,6 +769,66 @@
 			}
 		}
 
+		// Handle post_type separately, to include 'any'
+		$field_name = 'post_type';
+		$qtypes = array();
+		if ( ! empty( $this->query_vars[$field_name] ) ) {
+			$qtypes = $this->query_vars[$field_name];
+			if ( ! is_array( $qtypes ) ) {
+				$qtypes = explode(',', $qtypes);
+			}
+			$join_posts_table = true;
+			$ptypes = array();
+			if ( in_array( 'any', $qtypes ) ) {	
+				$ptypes = get_post_types();
+				if ( empty( $ptypes ) ) {
+					$this->sql_clauses['where'][ $field_name ] = ' AND 1=0 ';
+				}
+				else {
+					$esses = array_fill( 0, count( (array) $ptypes ), '%s' );
+					$this->sql_clauses['where'][ $field_name ] = $wpdb->prepare( " {$wpdb->posts}.{$field_name} IN (" . implode( ',', $esses ) . ')', $ptypes );
+				}
+			} else {
+				foreach ( get_post_types() as $ptype ) {
+					if ( in_array( $ptype, $qtypes ) ) {
+						$ptypes[] = $ptype;
+					}
+				}
+				$esses = array_fill( 0, count( (array) $ptypes ), '%s' );
+				$this->sql_clauses['where'][ $field_name ] = $wpdb->prepare( " {$wpdb->posts}.{$field_name} IN (" . implode( ',', $esses ) . ')', $ptypes );
+			}
+		}
+
+		// Handle post_status separately, to include 'any'
+		$field_name = 'post_status';
+		$qstatus = array();
+		if ( ! empty( $this->query_vars[$field_name] ) ) {
+			$qstatus = $this->query_vars[$field_name];
+			if ( ! is_array( $qstatus ) ) {
+				$qstatus = explode(',', $qstatus);
+			}
+			$join_posts_table = true;
+			$pstatus = array();
+			if ( in_array( 'any', $qstatus ) ) {
+				$pstatus = get_post_stati();
+				if ( empty( $pstatus ) ) {
+					$this->sql_clauses['where'][ $field_name ] = ' AND 1=0 ';
+				}
+				else {
+					$esses = array_fill( 0, count( (array) $pstatus ), '%s' );
+					$this->sql_clauses['where'][ $field_name ] = $wpdb->prepare( " {$wpdb->posts}.{$field_name} IN (" . implode( ',', $esses ) . ')', $pstatus );
+				}
+			} else {
+				foreach ( get_post_stati() as $pstati ) {
+					if ( in_array( $pstati, $qstatus ) ) {
+						$pstatus[] = $pstati;
+					}
+				}
+				$esses = array_fill( 0, count( (array) $pstatus ), '%s' );
+				$this->sql_clauses['where'][ $field_name ] = $wpdb->prepare( " {$wpdb->posts}.{$field_name} IN (" . implode( ',', $esses ) . ')', $pstatus );
+			}
+		}
+
 		// Comment author IDs for an IN clause.
 		if ( ! empty( $this->query_vars['author__in'] ) ) {
 			$this->sql_clauses['where']['author__in'] = 'user_id IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['author__in'] ) ) . ' )';
Index: tests/phpunit/tests/comment/query.php
===================================================================
--- tests/phpunit/tests/comment/query.php	(revision 36409)
+++ tests/phpunit/tests/comment/query.php	(working copy)
@@ -1820,6 +1820,100 @@
 	}
 
 	/**
+	 * @ticket 35512
+	 */
+	public function test_comments_query_any_post_type() {
+		register_post_type( 'post-type-1' , array ( 'exclude_from_search' => false  ) );
+		register_post_type( 'post-type-2' , array ( 'exclude_from_search' => false  ) );
+		register_post_type( 'post-type-3' , array ( 'exclude_from_search' => false  ) );
+
+		$p1 = self::factory()->post->create( array( 'post_type' => 'post-type-1' ) );
+		$p2 = self::factory()->post->create( array( 'post_type' => 'post-type-2' ) );
+		$p3 = self::factory()->post->create( array( 'post_type' => 'post-type-3' ) );
+
+		$c1 = self::factory()->comment->create_post_comments( $p1, 1 );
+		$c2 = self::factory()->comment->create_post_comments( $p2, 1 );
+		$c3 = self::factory()->comment->create_post_comments( $p3, 1 );
+
+		//case 1
+		$q = new WP_Comment_Query();
+		$found = $q->query( array(
+			'fields' => 'ids',
+			'post_type' => array( 'any', 'post-type-1' ),
+		) );
+		$this->assertEqualSets( array_merge( $c1, $c2, $c3 ), $found );
+
+		//case 2
+		$q = new WP_Comment_Query();
+		$found = $q->query( array(
+			'fields' => 'ids',
+			'post_type' => array( 'any' ),
+		) );
+		$this->assertEqualSets( array_merge( $c1, $c2, $c3 ), $found );
+
+		//case 3
+		$q = new WP_Comment_Query();
+		$found = $q->query( array(
+			'fields' => 'ids',
+			'post_type' => 'any',
+		) );
+		$this->assertEqualSets( array_merge( $c1, $c2, $c3 ), $found );
+
+		//case 4
+		$q = new WP_Comment_Query();
+		$found = $q->query( array(
+			'fields' => 'ids',
+		) );
+		$this->assertEqualSets( array_merge( $c1, $c2, $c3 ), $found );
+
+		_unregister_post_type( 'post-type-1' );
+		_unregister_post_type( 'post-type-2' );
+		_unregister_post_type( 'post-type-3' );
+	}
+
+	/**
+	 * @ticket 35512
+	 */
+	public function test_comments_query_any_post_status() {
+		$p1 = self::factory()->post->create( array( 'post_status' => 'publish' ) );
+		$p2 = self::factory()->post->create( array( 'post_status' => 'draft' ) );
+
+		$c1 = self::factory()->comment->create_post_comments( $p1, 1 );
+		$c2 = self::factory()->comment->create_post_comments( $p2, 1 );
+
+		//case 1
+		$q = new WP_Comment_Query();
+		$found = $q->query( array(
+			'fields' => 'ids',
+			'post_status' => array( 'any', 'draft' ),
+		) );
+		$this->assertEqualSets( array_merge( $c1, $c2 ), $found );
+
+		//case 2
+		$q = new WP_Comment_Query();
+		$found = $q->query( array(
+			'fields' => 'ids',
+			'post_status' => array( 'any' ),
+		) );
+		$this->assertEqualSets( array_merge( $c1, $c2 ), $found );
+
+		//case 3
+		$q = new WP_Comment_Query();
+		$found = $q->query( array(
+			'fields' => 'ids',
+			'post_status' => 'any',
+		) );
+		$this->assertEqualSets( array_merge( $c1, $c2 ), $found );
+
+		//case 4
+		$q = new WP_Comment_Query();
+		$found = $q->query( array(
+			'fields' => 'ids',
+		) );
+		$this->assertEqualSets( array_merge( $c1, $c2 ), $found );
+	}
+
+	/**
 	 * @ticket 24826
 	 */
 	public function test_comment_query_object() {
