================ @@ -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; + } ---------------- cor3ntin wrote:
I think a lot of people don't like them, but it is part of our coding standards, so you must https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements 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