From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7897) id 9E4C13858D38; Fri, 4 Nov 2022 07:57:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E4C13858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667548672; bh=RNlGCj032QvoUCLhUGKy5ex7/awy7VD0fzOTQjpdZu4=; h=From:To:Subject:Date:From; b=GJ0f7JBwCaCtvHFEUZPzouhNJeJtKI0kMp2Lg+isXc9OZzd4uddAVLxHetLoSfPI4 FdIuiVstWlWAJlmVNfMe/bucvcj/QjeYJHVcIT4CjRFga8x8TmxscurS1BCRoh0VVu rl4VJbePI1GAgCT3VLz5vgl+HN1DGDm1DLkyLaa8= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Torbjorn Svensson To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3646] c++: Use in-process client when networking is disabled X-Act-Checkin: gcc X-Git-Author: =?utf-8?q?Torbj=C3=B6rn_SVENSSON?= X-Git-Refname: refs/heads/master X-Git-Oldrev: fabe470b2441a4a760a5f491395631e53821b765 X-Git-Newrev: 97752b7c446e513677e9d49b0c57427d41aaebde Message-Id: <20221104075752.9E4C13858D38@sourceware.org> Date: Fri, 4 Nov 2022 07:57:52 +0000 (GMT) List-Id: https://gcc.gnu.org/g:97752b7c446e513677e9d49b0c57427d41aaebde commit r13-3646-g97752b7c446e513677e9d49b0c57427d41aaebde Author: Torbjörn SVENSSON Date: Tue Oct 25 16:11:05 2022 +0200 c++: Use in-process client when networking is disabled Without the patch, the output for bad-mapper-3.C would be: /src/gcc/gcc/testsuite/g++.dg/modules/bad-mapper-3.C:2:1: error: unknown Compiled Module Interface: no such module As this line is unexpected, the test case would fail. The same problem can also be seen for g++.dg/modules/bad-mapper-2.C. gcc/cp/ChangeLog: * mapper-client.cc: Use in-process client when networking is disabled. gcc/testsuite/ChangeLog: * g++.dg/modules/bad-mapper-3.C: Update dg-error pattern. Co-Authored-By: Yvan ROUX Signed-off-by: Torbjörn SVENSSON Diff: --- gcc/cp/mapper-client.cc | 4 ++++ gcc/testsuite/g++.dg/modules/bad-mapper-3.C | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc index fe9544b5ba4..8e331c0e896 100644 --- a/gcc/cp/mapper-client.cc +++ b/gcc/cp/mapper-client.cc @@ -227,6 +227,8 @@ module_client::open_module_client (location_t loc, const char *o, int fd = -1; #if CODY_NETWORKING fd = Cody::OpenLocal (&errmsg, name.c_str () + 1); +#else + errmsg = "disabled"; #endif if (fd >= 0) c = new module_client (fd, fd); @@ -254,6 +256,8 @@ module_client::open_module_client (location_t loc, const char *o, int fd = -1; #if CODY_NETWORKING fd = Cody::OpenInet6 (&errmsg, name.c_str (), port); +#else + errmsg = "disabled"; #endif name[colon] = ':'; diff --git a/gcc/testsuite/g++.dg/modules/bad-mapper-3.C b/gcc/testsuite/g++.dg/modules/bad-mapper-3.C index 9dab332ccb2..ab14dd39a67 100644 --- a/gcc/testsuite/g++.dg/modules/bad-mapper-3.C +++ b/gcc/testsuite/g++.dg/modules/bad-mapper-3.C @@ -1,6 +1,6 @@ // { dg-additional-options "-fmodules-ts -fmodule-mapper=localhost:172477262" } import unique3.bob; -// { dg-error {failed connecting mapper 'localhost:172477262'} "" { target *-*-* } 0 } +// { dg-error {failed (connecting|disabled) mapper 'localhost:172477262'} "" { target *-*-* } 0 } // { dg-prune-output "fatal error:" } // { dg-prune-output "failed to read" } // { dg-prune-output "compilation terminated" }