aaron.ballman added inline comments.

================
Comment at: lib/Sema/SemaChecking.cpp:7711-7715
+  // It's an integer promotion if the destination type is the promoted
+  // source type.
+  return ICE->getCastKind() == CK_IntegralCast &&
+         From->isPromotableIntegerType() &&
+         S.Context.getPromotedIntegerType(From) == To;
----------------
This check is not checking against the promoted type of the bit-field. See 
`Sema::UsualArithmeticConversions()` for an example of what I'm talking about. 
Is that expected?


================
Comment at: test/Sema/format-strings-bitfield-promotion.c:1
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -verify %s
+
----------------
Running your test through GCC looks like the behavior matches here for C; can 
you also add a C++ test that demonstrates the behavior does not change?

https://godbolt.org/z/zRYDMG


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D51211/new/

https://reviews.llvm.org/D51211



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to