Hi!

All of warning, error_at and inform functions emit a newline after the
message, so trailing whitespace is undesirable there.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
committed to trunk as obvious.

2018-03-16  Jakub Jelinek  <ja...@redhat.com>

        PR c/84910
        * c-warn.c (diagnose_mismatched_attributes): Remove trailing space from
        diagnostics.

        * parser.c (cp_parser_lambda_introducer): Remove trailing space from
        diagnostics.
        * method.c (synthesize_method): Likewise.
        * pt.c (convert_nontype_argument): Likewise.

--- gcc/c-family/c-warn.c.jj    2018-03-13 00:38:23.808662251 +0100
+++ gcc/c-family/c-warn.c       2018-03-16 17:36:31.431124231 +0100
@@ -2258,7 +2258,7 @@ diagnose_mismatched_attributes (tree old
           && DECL_UNINLINABLE (newdecl)
           && lookup_attribute ("noinline", DECL_ATTRIBUTES (newdecl)))
     warned |= warning (OPT_Wattributes, "declaration of %q+D with attribute "
-                      "%qs follows inline declaration ", newdecl, noinline);
+                      "%qs follows inline declaration", newdecl, noinline);
 
   return warned;
 }
--- gcc/cp/parser.c.jj  2018-03-15 08:36:27.982776658 +0100
+++ gcc/cp/parser.c     2018-03-16 17:35:17.628093001 +0100
@@ -10383,7 +10383,7 @@ cp_parser_lambda_introducer (cp_parser*
                   && TREE_CODE (capture_init_expr) != PARM_DECL)
            {
              error_at (capture_token->location,
-                       "capture of non-variable %qE ",
+                       "capture of non-variable %qE",
                        capture_init_expr);
              if (DECL_P (capture_init_expr))
                inform (DECL_SOURCE_LOCATION (capture_init_expr),
--- gcc/cp/method.c.jj  2018-01-27 07:26:08.357912834 +0100
+++ gcc/cp/method.c     2018-03-16 17:35:42.024103324 +0100
@@ -950,7 +950,7 @@ synthesize_method (tree fndecl)
   pop_deferring_access_checks ();
 
   if (error_count != errorcount || warning_count != warningcount + werrorcount)
-    inform (input_location, "synthesized method %qD first required here ",
+    inform (input_location, "synthesized method %qD first required here",
            fndecl);
 }
 
--- gcc/cp/pt.c.jj      2018-03-15 08:36:27.980776658 +0100
+++ gcc/cp/pt.c 2018-03-16 17:34:06.575062936 +0100
@@ -6753,7 +6753,7 @@ convert_nontype_argument (tree type, tre
              else
                expr = cxx_constant_value (expr);
              if (errorcount > errs || warningcount + werrorcount > warns)
-               inform (loc, "in template argument for type %qT ", type);
+               inform (loc, "in template argument for type %qT", type);
              if (expr == error_mark_node)
                return NULL_TREE;
              /* else cxx_constant_value complained but gave us

        Jakub

Reply via email to