[all-commits] [llvm/llvm-project] 4f8e29: [Sema] Fix diagnostics for one-byte length modifier

Anton Bikineev via All-commits all-commits at lists.llvm.org
Tue Mar 9 07:57:23 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4f8e299785e860cf974d696d7ca83b70a94977fe
      https://github.com/llvm/llvm-project/commit/4f8e299785e860cf974d696d7ca83b70a94977fe
  Author: Anton Bikineev <bikineev at chromium.org>
  Date:   2021-03-09 (Tue, 09 Mar 2021)

  Changed paths:
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/FixIt/format.m

  Log Message:
  -----------
  [Sema] Fix diagnostics for one-byte length modifier

In case a char-literal of type int (C/ObjectiveC) corresponds to a
format specifier with the %hh length modifier, don't treat the literal
as of type char for issuing diagnostics, as otherwise this results in:

printf("%hhd", 'e');
warning: format specifies type 'char' but the argument has type 'char'.

Differential revision: https://reviews.llvm.org/D97951




More information about the All-commits mailing list