View | Details | Raw Unified | Return to bug 242810 | Differences between
and this patch

Collapse All | Expand All

(-)b/contrib/llvm-project/clang/lib/Sema/SemaInit.cpp (-3 / +3 lines)
Lines 9150-9158 static void DiagnoseNarrowingInInitList(Sema &S, Link Here
9150
    return;
9150
    return;
9151
9151
9152
  case NK_Type_Narrowing:
9152
  case NK_Type_Narrowing:
9153
    // This was a floating-to-integer conversion, which is always considered a
9153
    // This was a floating-to-integer conversion or a boolean conversion from a
9154
    // narrowing conversion even if the value is a constant and can be
9154
    // pointer, which is always considered a narrowing conversion even if the
9155
    // represented exactly as an integer.
9155
    // value is a constant and can be represented exactly as an integer.
9156
    S.Diag(PostInit->getBeginLoc(), NarrowingErrs(S.getLangOpts())
9156
    S.Diag(PostInit->getBeginLoc(), NarrowingErrs(S.getLangOpts())
9157
                                        ? diag::ext_init_list_type_narrowing
9157
                                        ? diag::ext_init_list_type_narrowing
9158
                                        : diag::warn_init_list_type_narrowing)
9158
                                        : diag::warn_init_list_type_narrowing)
(-)b/contrib/llvm-project/clang/lib/Sema/SemaOverload.cpp (-2 / +2 lines)
Lines 314-321 NarrowingKind StandardConversionSequence::getNarrowingKind( Link Here
314
    if (FromType->isIntegralOrUnscopedEnumerationType())
314
    if (FromType->isIntegralOrUnscopedEnumerationType())
315
      goto IntegralConversion;
315
      goto IntegralConversion;
316
    // Boolean conversions can be from pointers and pointers to members
316
    // Boolean conversions can be from pointers and pointers to members
317
    // [conv.bool], and those aren't considered narrowing conversions.
317
    // [conv.bool], which are considered narrowing conversions.
318
    return NK_Not_Narrowing;
318
    return NK_Type_Narrowing;
319
319
320
  // -- from a floating-point type to an integer type, or
320
  // -- from a floating-point type to an integer type, or
321
  //
321
  //

Return to bug 242810