================
@@ -10509,14 +10516,18 @@ static bool AnalyzeBitFieldAssignment(Sema &S, 
FieldDecl *Bitfield, Expr *Init,
                  ED->getNumPositiveBits() == FieldWidth) {
         DiagID = diag::warn_signed_bitfield_enum_conversion;
       }
-
+      unsigned PreferredTypeDiagIndex = PTAttr != nullptr;
       if (DiagID) {
-        S.Diag(InitLoc, DiagID) << Bitfield << ED;
+        S.Diag(InitLoc, DiagID) << Bitfield << PreferredTypeDiagIndex << ED;
         TypeSourceInfo *TSI = Bitfield->getTypeSourceInfo();
         SourceRange TypeRange =
             TSI ? TSI->getTypeLoc().getSourceRange() : SourceRange();
         S.Diag(Bitfield->getTypeSpecStartLoc(), 
diag::note_change_bitfield_sign)
             << SignedEnum << TypeRange;
+        if (PTAttr) {
+          S.Diag(PTAttr->getLocation(), diag::note_bitfield_preferred_type)
+              << ED;
+        }
----------------
ojhunt wrote:

Must I :D ?

I don't like unbraced multiline blocks even if it's a single statement and so 
the braces are "unnecessary".

https://github.com/llvm/llvm-project/pull/116785
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to