[LLVMbugs] [Bug 21935] error: cannot initialize a variable of type 'char *' with an rvalue of type 'const char *'

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Dec 17 01:42:13 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=21935

David Majnemer <david.majnemer at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |david.majnemer at gmail.com
         Resolution|---                         |INVALID

--- Comment #1 from David Majnemer <david.majnemer at gmail.com> ---
C++11 [lex.string]p8:
Ordinary string literals and UTF-8 string literals are also referred to as
narrow string literals. A narrow string literal has type "array of n const
char", where n is the size of the string as defined below, and has static
storage duration.

C++11 [conv.qual]p1:
A prvalue of type "pointer to cv1 T" can be converted to a prvalue of type
"pointer to cv2 T" if "cv2 T" is more cv-qualified than "cv1 T".

MSVC gives string literals a non-const type which makes it in violation of the
standard.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141217/7968af34/attachment.html>


More information about the llvm-bugs mailing list