Issue 23548 - [REG 2.098] C sources files have precedent over D modules in imports
Summary: [REG 2.098] C sources files have precedent over D modules in imports
Status: RESOLVED DUPLICATE of issue 23547
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: ImportC, pull, rejects-valid, wrong-code
Depends on:
Blocks:
 
Reported: 2022-12-10 15:12 UTC by Iain Buclaw
Modified: 2022-12-30 23:38 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Iain Buclaw 2022-12-10 15:12:41 UTC
Same as issue 23547, but this affects incidental C sources in the build tree.

$ dmd -I=imports importd.d
importd.d(2): Error: undefined identifier `Have_Qsort_R`
importd.d(2):        while evaluating: `static assert(Have_Qsort_R)`


importd.d
```
import gcc.config;
static assert(Have_Qsort_R);
```

imports/gcc/config.d
```
module gcc.config;
enum Have_Qsort_R = true;
```

gcc/config.c
```
#ifndef GCC_CONFIG_H
#define GCC_CONFIG_H
#ifdef GENERATOR_FILE
#error config.h is for the host, not build, machine.
#endif
#ifdef IN_GCC
# include "ansidecl.h"
#endif
#endif /* GCC_CONFIG_H */
```

Introduced by https://github.com/dlang/dmd/pull/12507
Comment 1 Dlang Bot 2022-12-12 13:53:50 UTC
@ibuclaw created dlang/dmd pull request #14687 "fix Issue 23548 - [REG 2.098] C sources files have precedent over D modules in imports" fixing this issue:

- fix Issue 23548 - [REG 2.098] C sources files have precedent over D modules in imports

https://github.com/dlang/dmd/pull/14687
Comment 2 Dlang Bot 2022-12-12 15:05:24 UTC
dlang/dmd pull request #14687 "fix Issue 23548 - [REG 2.098] C sources files have precedent over D modules in imports" was merged into stable:

- a053bb8d3bdeb8e887ce428708b13d21ebda215a by Iain Buclaw:
  fix Issue 23548 - [REG 2.098] C sources files have precedent over D modules in imports

https://github.com/dlang/dmd/pull/14687
Comment 3 Dlang Bot 2022-12-15 13:56:59 UTC
dlang/dmd pull request #14692 "Revert "fix Issue 23548 - [REG 2.098] C sources files have precedent over D modules in imports"" was merged into stable:

- bb748e396725191e7b44f6dda41901028aeb4703 by Walter Bright:
  Revert "fix Issue 23548 - [REG 2.098] C sources files have precedent over D modules in imports"
  
  This reverts commit bc3280bef9aeac70c2bebf64c5f316e0dcec409a.

https://github.com/dlang/dmd/pull/14692
Comment 4 Dlang Bot 2022-12-15 15:49:07 UTC
dlang/dmd pull request #14700 "fix Issue 23548 - [REG 2.098] C sources files have precedent over D modules in imports" was merged into master:

- bca0b32314c87100307a66129a0d8349e892de52 by Iain Buclaw:
  fix Issue 23548 - [REG 2.098] C sources files have precedent over D modules in imports

https://github.com/dlang/dmd/pull/14700
Comment 5 Dlang Bot 2022-12-15 18:56:29 UTC
@ibuclaw created dlang/dmd pull request #14701 "merge stable" fixing this issue:

- fix Issue 23548 - [REG 2.098] C sources files have precedent over D modules in imports

- Revert "fix Issue 23548 - [REG 2.098] C sources files have precedent over D modules in imports"
  
  This reverts commit bc3280bef9aeac70c2bebf64c5f316e0dcec409a.

https://github.com/dlang/dmd/pull/14701
Comment 6 Dlang Bot 2022-12-15 22:50:07 UTC
dlang/dmd pull request #14701 "merge stable" was merged into master:

- bc3280bef9aeac70c2bebf64c5f316e0dcec409a by Iain Buclaw:
  fix Issue 23548 - [REG 2.098] C sources files have precedent over D modules in imports

- f36d41bfd5bd98f8c6b4e399583ed685d779ebed by Walter Bright:
  Revert "fix Issue 23548 - [REG 2.098] C sources files have precedent over D modules in imports"
  
  This reverts commit bc3280bef9aeac70c2bebf64c5f316e0dcec409a.

https://github.com/dlang/dmd/pull/14701
Comment 7 Iain Buclaw 2022-12-30 23:38:56 UTC

*** This issue has been marked as a duplicate of issue 23547 ***