[all-commits] [llvm/llvm-project] 1499cc: [clang] Improve diagnostic for "initializer-string...

Evan Smal via All-commits all-commits at lists.llvm.org
Thu Jan 19 04:13:31 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1499cce2646cbf4dd78f8534a4e71bd856b10994
      https://github.com/llvm/llvm-project/commit/1499cce2646cbf4dd78f8534a4e71bd856b10994
  Author: Evan Smal <evan.smal at hotmail.com>
  Date:   2023-01-19 (Thu, 19 Jan 2023)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaInit.cpp
    M clang/test/CXX/dcl.decl/dcl.init/dcl.init.string/p2.cpp

  Log Message:
  -----------
  [clang] Improve diagnostic for "initializer-string for char array is too long"

This patch improves the diagnostic message "initializer-string for
char array is too long" by specifying an expected array length and by
indicating that the initializer string implicitly includes the
null terminator.

Fixes #58829

Differential Revision: https://reviews.llvm.org/D141283




More information about the All-commits mailing list