www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22625] New: importC: original name of typedef'd struct not


          Issue ID: 22625
           Summary: importC: original name of typedef'd struct not visible
                    in D when compiling separately
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: duser airmail.cc

typedef struct data_s {
        int x;
} data_t;

import cmodule : data_s, data_t;

compile using "dmd -c dmodule.d" and get this:

  dmodule.d(1): Error: module `cmodule` import `data_s` not found, did you mean
alias `cmodule.data_t`?

if the C file is added to the command line like "dmd -c dmodule.d cmodule.c",
then the error goes away

version: DMD64 D Compiler v2.098.0-361-g415e58e6d

Dec 22 2021