public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] c++: Make diagnostic translatable [PR109309]
@ 2023-03-28 15:50 Jonathan Wakely
  2023-03-28 15:52 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Wakely @ 2023-03-28 15:50 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jason Merrill

Tested x86_64-linux. OK for trunk?

-- >8 --

gcc/cp/ChangeLog:

	PR c++/109309
	* contracts.cc (check_postcondition_result): Use complete
	strings for diagnostics, so they can be translated.
---
 gcc/cp/contracts.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/cp/contracts.cc b/gcc/cp/contracts.cc
index 8aca1bade89..20ae4e3b14b 100644
--- a/gcc/cp/contracts.cc
+++ b/gcc/cp/contracts.cc
@@ -639,12 +639,12 @@ check_postcondition_result (tree decl, tree type, location_t loc)
   {
     const char* what;
     if (DECL_CONSTRUCTOR_P (decl))
-      what = "constructor";
+      what = "constructor does not return a value to test";
     else if (DECL_DESTRUCTOR_P (decl))
-      what  = "destructor";
+      what = "destructor does not return a value to test";
     else
-      what = "function";
-    error_at (loc, "%s does not return a value to test", what);
+      what = "function does not return a value to test";
+    error_at (loc, "%s", what);
     return false;
   }
 
-- 
2.39.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] c++: Make diagnostic translatable [PR109309]
  2023-03-28 15:50 [PATCH] c++: Make diagnostic translatable [PR109309] Jonathan Wakely
@ 2023-03-28 15:52 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2023-03-28 15:52 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jason Merrill

Ignore this one - jakub just committed a fix.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-28 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-28 15:50 [PATCH] c++: Make diagnostic translatable [PR109309] Jonathan Wakely
2023-03-28 15:52 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).