[Issue 3243] Mixin 'static this()' bring on a compiler message ': __gate is thread local'

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 8 16:00:20 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3243


Jeremie Pelletier <jeremiep at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |jeremiep at gmail.com


--- Comment #1 from Jeremie Pelletier <jeremiep at gmail.com> 2009-09-08 16:00:15 PDT ---
Here's the patch:

--- orig\func.cpp       Thu Sep 03 01:01:40 2009
+++ dmd\func.cpp        Tue Sep 08 18:54:46 2009
@@ -2759,7 +2759,7 @@
         */
        Identifier *id = Lexer::idPool("__gate");
        VarDeclaration *v = new VarDeclaration(0, Type::tint32, id, NULL);
-       v->storage_class = STCstatic;
+       v->storage_class = STCstatic | STCgshared;
        Statements *sa = new Statements();
        Statement *s = new DeclarationStatement(0, v);
        sa->push(s);

When a static constructor is coming from a template, a "gate" is added to
prevent running it more than once. That gate was not marked with __gshared.

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


More information about the Digitalmars-d-bugs mailing list