www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - =?UTF-8?B?W0lzc3VlIDIyNzQxXSBOZXc6IGltcG9ydEM6IEVycm9yOiBic3dh?=


          Issue ID: 22741
           Summary: importC: Error: bswap isn’t a template
           Product: D
           Version: D2
          Hardware: x86
                OS: All
            Status: NEW
          Keywords: ImportC
          Severity: major
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: dave287091 gmail.com

__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

Feb 05 2022