www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22228] New: [CTFE] taking address of immutable in frame


          Issue ID: 22228
           Summary: [CTFE] taking address of immutable in frame function
                    causes ICE on Unix platforms
           Product: D
           Version: D2
          Hardware: x86
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: Ajieskola gmail.com

auto f()
{   immutable int i;
    auto p = (() => &i)();

    return 0;

enum ctfeInvocation = f;

This results in an ICE on latest DMD:s if running with Linux, FreeBSD or
Darwin. It has regressed only recently, probably after latest stable release as
I'm unable to reproduce on run.dlang.io

Blocking https://github.com/dlang/phobos/pull/8202

Aug 20 2021