aarch64: Use error_n for plural text [PR104897]
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 5 Apr 2022 16:31:35 +0000 (17:31 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 5 Apr 2022 16:31:35 +0000 (17:31 +0100)
Use error_n rather than error_at for “%d vectors”, so that
translators can pick different translations based on the
number (2 vs more than 2, etc.)

gcc/
PR target/104897
* config/aarch64/aarch64-sve-builtins.cc
(function_resolver::infer_vector_or_tuple_type): Use error_n
for "%d vectors" messages.

gcc/config/aarch64/aarch64-sve-builtins.cc

index 3381726..5d1348a 100644 (file)
@@ -1352,13 +1352,17 @@ function_resolver::infer_vector_or_tuple_type (unsigned int argno,
                        " expects a single SVE vector rather than a tuple",
                        actual, argno + 1, fndecl);
            else if (size_i == 0 && type_i != VECTOR_TYPE_svbool_t)
-             error_at (location, "passing single vector %qT to argument %d"
-                       " of %qE, which expects a tuple of %d vectors",
-                       actual, argno + 1, fndecl, num_vectors);
+             /* num_vectors is always != 1, so the singular isn't needed.  */
+             error_n (location, num_vectors, "%qT%d%qE%d",
+                      "passing single vector %qT to argument %d"
+                      " of %qE, which expects a tuple of %d vectors",
+                      actual, argno + 1, fndecl, num_vectors);
            else
-             error_at (location, "passing %qT to argument %d of %qE, which"
-                       " expects a tuple of %d vectors", actual, argno + 1,
-                       fndecl, num_vectors);
+             /* num_vectors is always != 1, so the singular isn't needed.  */
+             error_n (location, num_vectors, "%qT%d%qE%d",
+                      "passing %qT to argument %d of %qE, which"
+                      " expects a tuple of %d vectors", actual, argno + 1,
+                      fndecl, num_vectors);
            return NUM_TYPE_SUFFIXES;
          }
       }