https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122677

            Bug ID: 122677
           Summary: [modules] g++ cannot write CMI if a repository path is
                    absolute.
           Product: gcc
           Version: 15.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mtxn at duck dot com
  Target Milestone: ---

Created attachment 62789
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62789&action=edit
bugfix

location: 
  gcc/cp/module.cc -> void create_dirs(char* path):

context:
  int mkdir(const char *pathname, mode_t mode):
    returns -1 at error.

bug:
  (int)failed && (bool)(errno != EEXIST)

description:
  -1 is considered "true".
  As the result of this bug cc1plus is unable to create module repository if
the provided repository path is absolute.

studied example:
  g++ -fmodules -xc++-system-header ext/stdio_filebuf.h
-fmodule-mapper="|@g++-mapper-server -r /tmp/test.gcm"

  result:
    g++ fails to create "/tmp/test.gcm" directory.

I included simplest valid bug fix i found as an attachment.

Reply via email to