www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - extern (C) member function causes internal compiler error

reply Chris Newton <redshodan yahoo.com> writes:
This code cause the following internal compiler error on DMD .106 on linux
(Fedora Core 2) with gcc (GCC) 3.3.3 20040412 (Red Hat Linux 3.3.3-7)

class Foo
{
  extern (C) static void staticCFunc()
  {
    Foo.func();
  }

  void func() {}
}


[baron athe trunk]$ dmd -c  test2.d -I/usr/local/include/D/phobos
Internal error: e2ir.c 814

Now obviously calling func() without an object is wrong, but I
don't think it should cause a compiler error. :) If in staticFunc() you
supply the call to func() with an object, it compiles well and good. Also,
if the static function is external to the class, the compiler correctly
reports a compile error and exits cleanly.

Chris Newton
Dec 12 2004
parent "Thomas Kuehne" <thomas-dloop kuehne.cn> writes:
this has been fixed since dmd-0.107, the current version is dmd-0.109

Thomas

"Chris Newton" <redshodan yahoo.com> schrieb im Newsbeitrag
news:pan.2004.12.12.11.25.40.211547 yahoo.com...
 This code cause the following internal compiler error on DMD .106 on linux
 (Fedora Core 2) with gcc (GCC) 3.3.3 20040412 (Red Hat Linux 3.3.3-7)

 class Foo
 {
   extern (C) static void staticCFunc()
   {
     Foo.func();
   }

   void func() {}
 }


 [baron athe trunk]$ dmd -c  test2.d -I/usr/local/include/D/phobos
 Internal error: e2ir.c 814
Dec 12 2004