www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2391] New: Character array literals are not recognized as string literals

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

           Summary: Character array literals are not recognized as string
                    literals
           Product: D
           Version: 2.019
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: samukha voliacable.com


pragma(msg, ['c']);

test.d(7): pragma msg string expected for message, not '['c']'

Also, __traits:
----
struct S
{
    static int x;
}

void main()
{
    S s;
    __traits(getMember, s, ['x']) = 1;
}
----
test.d(15): Error: string expected as second argument of __traits getMember
instead of ['x']


-- 
Oct 04 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2391





------- Comment #1 from samukha voliacable.com  2008-10-04 04:10 -------
In the above, S instance is unnecessary. Corrected:
----
struct S
{
    static int x;
}

void main()
{
    __traits(getMember, S, ['x']) = 1;
}
----


-- 
Oct 04 2008
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2391


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |DUPLICATE


--- Comment #2 from yebblies <yebblies gmail.com> 2011-06-30 17:34:35 EST ---
This has the same cause as bug 2391: array literals are not accepted when a
compile-time string is required.

*** This issue has been marked as a duplicate of issue 2156 ***

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