[Issue 5796] New: ICE with pragma(msg, ...) after missing '; ' in a template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 30 08:41:17 PDT 2011


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

           Summary: ICE with pragma(msg, ...) after missing ';' in a
                    template
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: kennytm at gmail.com


--- Comment #0 from kennytm at gmail.com 2011-03-30 08:37:48 PDT ---
When a 'pragma(msg, ...)' pragma has a missing comma, the subsequent
pragma(msg, ...) will result in a segfault.

------
template A(B) {
    pragma(msg, B)    // <-- missing ';'
    enum A = 0;
}
enum a = A!int;

pragma(msg, 0);
------

The error exists at least since 2.042 http://ideone.com/MVgnG, and still
persists in 2.052. The segfault is raised in 'ExpInitializer::semantic' in
'init.c':


Initializer *ExpInitializer::semantic(Scope *sc, Type *t)
{
    //printf("....
    exp = exp->semantic(sc);
    exp = resolveProperties(sc, exp);
    exp = exp->optimize(WANTvalue | WANTinterpret);
    Type *tb = t->toBasetype();                        // <-- this line

-- 
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