www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21691] New: premature mangleof can be accessed when pragma


          Issue ID: 21691
           Summary: premature mangleof can be accessed when pragma mangle
                    calls the function it's applied to
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dkorpel live.nl

I did not hit this bug in the wild so I'm marking it as only a minor issue, but
found this when testing https://github.com/dlang/dmd/pull/12252:
pragma(mangle, getFoo())
string getFoo() 
    pragma(msg, getFoo.mangleof);
    return "foo";
pragma(msg, getFoo.mangleof);

It should raise a forward reference error, but instead a premature .mangleof is printed. --
Mar 08 2021