Index: src/wp-includes/comment-template.php
===================================================================
--- src/wp-includes/comment-template.php	(revision 38674)
+++ src/wp-includes/comment-template.php	(working copy)
@@ -2198,15 +2198,18 @@
 	 * @param array $fields The default comment fields.
 	 */
 	$fields = apply_filters( 'comment_form_default_fields', $fields );
+
+	if ( get_option( 'users_can_register' ) ) {
+		$must_log_in = '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment or <a href="%s">register</a> here.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ), wp_registration_url() ) . '</p>';
+	} else {
+		$must_log_in = '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>';
+	}
+
 	$defaults = array(
 		'fields'               => $fields,
 		'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required="required"></textarea></p>',
 		/** This filter is documented in wp-includes/link-template.php */
-		'must_log_in'          => '<p class="must-log-in">' . sprintf(
-		                              /* translators: %s: login URL */
-		                              __( 'You must be <a href="%s">logged in</a> to post a comment.' ),
-		                              wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) )
-		                          ) . '</p>',
+		'must_log_in'          => $must_log_in,
 		/** This filter is documented in wp-includes/link-template.php */
 		'logged_in_as'         => '<p class="logged-in-as">' . sprintf(
 		                              /* translators: 1: edit user link, 2: accessibility text, 3: user name, 4: logout URL */
