Bug 22741 – importC: Error: bswap isn’t a template

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2022-02-06T03:20:58Z
Last change time
2022-02-06T09:15:27Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
dave287091

Comments

Comment #0 by dave287091 — 2022-02-06T03:20:58Z
__builtins.di tries to instantiate bswap as templates, but core.bitop.bswap is an overloaded function. Additionally, the ushort version is called byteswap. Example code: int foo(int c){ return __builtin_bswap32(c); // Error: template instance `__builtins.__builtin_bswap32!()` error instantiating } druntime/import/__builtins.di(81): Error: `bswap` isn't a template
Comment #1 by dlang-bot — 2022-02-06T08:11:08Z
@WalterBright created dlang/druntime pull request #3729 "fix Issue 22741 - importC: Error: bswap isn.t a template" fixing this issue: - fix Issue 22741 - importC: Error: bswap isn.t a template https://github.com/dlang/druntime/pull/3729
Comment #2 by dlang-bot — 2022-02-06T09:15:27Z
dlang/druntime pull request #3729 "fix Issue 22741 - importC: Error: bswap isn.t a template" was merged into master: - 13971a42c4bb7b871101d9d2892d6ed0986e230b by Walter Bright: fix Issue 22741 - importC: Error: bswap isn.t a template https://github.com/dlang/druntime/pull/3729