www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4737] New: enum breaks linker when passed to typeid()

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4737

           Summary: enum breaks linker when passed to typeid()
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com



14:34:39 PDT ---
module test;

import std.stdio;

unittest
{
    enum X { A = 3, B, C }
    X x; 

    write(typeid(x));
    write(typeid(X));   
}

void main()
{
}

 Error 42: Symbol Undefined _D4test11__unittest1FZv1X6__initZ

Sometimes it will compile, but then the app crashes and I get an access
violation message in console.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 26 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4737


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|enum breaks linker when     |typeid doesn't work for
                   |passed to typeid()          |scoped enum with
                   |                            |initializer



19:11:53 PDT ---
typeid works with scoped enums, but not with ones that have an initializer.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 20 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4737


SomeDude <lovelydear mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear mailmetrash.com



PDT ---
Compiles and runs fine on 2.059 Win32

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 21 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4737




15:31:23 PDT ---

 Compiles and runs fine on 2.059 Win32
No. Please remember to compile with -unittest. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 21 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4737




PDT ---
Oups, didn't see it. I guess it's time to go to bed... :)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 21 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4737




16:15:22 PDT ---

 Oups, didn't see it. I guess it's time to go to bed... :)
No worries. I was on a closing closing streak once ages ago and I ended up accidentally closing a bunch of DMD 1.x bugs because I couldn't recreate them in 2.x (I wasn't looking at the Version field above). They all had to be reverted to open again. :) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 21 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4737




PST ---
http://dpaste.dzfl.pl/fork/7f894621

2.060
DMD: compilation failure
GDC: compiles and runs but no output
LDC: compiles and runs with the following output
     c19.__unittest1.X
     c19.__unittest1.X

(c19 being the execution instance)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 31 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4737




13:33:48 PST ---

 GDC: compiles and runs but no output
DPaste might be using -unittest by mistake instead of -funittest for GDC. Run it with `gdc -m32 -funittest test.d && a.exe` and you'll see the output. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 31 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4737


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME



22:20:38 PST ---
Resolved in 2.062 git-head by a pull for another report (dupe of this one).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 09 2013