On 1/4/19 7:25 PM, Martin Sebor wrote:
On 12/27/18 1:49 PM, Tom Honermann wrote:
As requested by Jason in the review of the P0482 (char8_t) core language changes, this patch includes updates to the error messages emitted for ill-formed cases of array initialization with a string literal.  With these changes, error messages that previously looked something like these:

- "char-array initialized from wide string"
- "wide character array initialized from non-wide string"
- "wide character array initialized from incompatible wide string"

now look like:

- "cannot initialize array of type 'char' from a string literal with type array of 'short unsigned int'"

The first word "type" doesn't quite work here.  The type of every
array is "array of T" where T is the type of the element, so for
instance, "array of char."  Saying "array of type X" makes it sound
like X is the type of the whole array, which is of course not
the case when X is char.  I think you want to use the same wording
as for the second type:

  "cannot initialize array of 'char' from a string literal with
  type array of 'short unsigned int'"

or perhaps even better

  "cannot initialize array of 'char' from a string literal with
  type 'char16_t[N]'"

(i.e., show the actual type of the string, including its bound).

Thank you for the feedback, Martin; sorry for the delayed response.  I'll follow up with a revised patch within the next week or two.

Tom.


Martin


Reply via email to