[PATCH] Consider unsigned long for non-u/U decimal literals (C90/C++03)

Hubert Tong hubert.reinterpretcast at gmail.com
Thu May 21 14:25:25 PDT 2015


Ping.

On Fri, May 15, 2015 at 10:31 AM, Hubert Tong <
hubert.reinterpretcast at gmail.com> wrote:

> Hi rsmith, fraggamuffin,
>
> This modifies Clang to reflect that under pre-C99 ISO C, decimal
> constants may have type `unsigned long` even if they do not contain `u`
> or `U` in their suffix (C90 subclause 6.1.3.2 paragraph 5). The same is
> done for C++ without C++11 which--because of undefined behaviour--allows
> for behaviour compatible with ISO C90 in the case of an unsuffixed
> decimal literal and is otherwise identical to C90 in its treatment of
> integer literals (C++03 subclause 2.13.1 [lex.icon] paragraph 2).
>
> A message is added alongside `ext_integer_literal_too_large_for_signed`
> to the `implicitly-unsigned-literal` group to warn on this additional
> cause of implicitly unsigned literals.
>
> Fixes PR 16678.
>
> http://reviews.llvm.org/D9794
>
> Files:
>   include/clang/Basic/DiagnosticCommonKinds.td
>   include/clang/Basic/DiagnosticGroups.td
>   lib/Sema/SemaExpr.cpp
>   test/Sema/PR16678new32.c
>   test/Sema/PR16678new32.cpp
>   test/Sema/PR16678new64.c
>   test/Sema/PR16678new64.cpp
>   test/Sema/PR16678old32.c
>   test/Sema/PR16678old32.cpp
>   test/Sema/PR16678old64.c
>   test/Sema/PR16678old64.cpp
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150521/6fcb0e02/attachment.html>


More information about the cfe-commits mailing list