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

            Bug ID: 101441
           Summary: __FUNCTION__ doesn't work in core.stdc.stdio functions
                    without cast
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: SztfG at yandex dot ru
  Target Milestone: ---

testcase:

import core.stdc.stdio;

extern(C) int main(int argc, char **argv)
{
  // works in ldc, dmd, doesnt work in gdc
  puts(__FUNCTION__);
  puts("test" ~ __FUNCTION__ ~ "test");

  // works everywhere
  puts(cast(char*)__FUNCTION__);
  puts(cast(char*)("test " ~ __FUNCTION__ ~ "test"));
  return 0;
}

Reply via email to