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