www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9856] New: Unintuitive sizeof evaluation for invalid class declaration

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

           Summary: Unintuitive sizeof evaluation for invalid class
                    declaration
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg gmail.com> 2013-04-02 02:03:05 PDT ---
This sample code comes from bug 4269 (it's already closed):

Code:
----
static if (__traits(compiles, A.sizeof))
{
    pragma(msg, "A.sizeof compiles!");
}
class A
{
    void foo(B b);  // line 7
}

Output:
----
test.d(7): Error: undefined identifier B, did you mean class A?
A.sizeof compiles!

Why pragma declaration inside "static if" is evaluated?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 02 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9856


Kenji Hara <k.hara.pg gmail.com> changed:

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


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2013-04-05 04:13:30 PDT ---
*** This issue has been marked as a duplicate of issue 9879 ***

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