[cfe-commits] r154619 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaExpr.cpp test/SemaObjC/objc-literal-nsnumber.m

Eli Friedman eli.friedman at gmail.com
Thu Apr 12 14:37:05 PDT 2012


On Thu, Apr 12, 2012 at 2:24 PM, Fariborz Jahanian <fjahanian at apple.com> wrote:
> Author: fjahanian
> Date: Thu Apr 12 16:24:56 2012
> New Revision: 154619
>
> URL: http://llvm.org/viewvc/llvm-project?rev=154619&view=rev
> Log:
> objective-c literals: Issue warning and ignore
> when BOOL is not of an intergal type when
> boolean literals are used. // rdar://11231426
>
> Modified:
>    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
>    cfe/trunk/lib/Sema/SemaExpr.cpp
>    cfe/trunk/test/SemaObjC/objc-literal-nsnumber.m
>
> Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=154619&r1=154618&r2=154619&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
> +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Apr 12 16:24:56 2012
> @@ -1547,6 +1547,9 @@
>   "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
>  }
>
> +def warn_bool_for_boolean_literal : Warning<
> +  "BOOL of type %0 is non-intergal and unsuitable for a "
> +  "boolean literal - ignored">, InGroup<DiagGroup<"numeric-literals">>;

"intergal"?

In any case, is it really worth warning here?  If we really want to
warn about constructs like this, we should warn about the typedef
itself, not the bool literal.

-Eli




More information about the cfe-commits mailing list