[cfe-commits] [PATCH] Improved handling of 128-bit integer literals

Dmitri Gribenko gribozavr at gmail.com
Sat Nov 24 13:36:21 PST 2012


On Sat, Nov 24, 2012 at 10:53 PM, Stephen Canon <scanon at apple.com> wrote:
> On Nov 24, 2012, at 3:09 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>
>> On Sat, Nov 24, 2012 at 6:59 PM, Stephen Canon <scanon at apple.com> wrote:
>>> Updated patch with feedback from the first round.  Please review.
>>
>> What about checking the type of literals with something like this:
>>
>> template<typename T, typename U>
>> struct is_same {
>>  static const bool value = false;
>> };
>>
>> template<typename T>
>> struct is_same<T, T> {
>>  static const bool value = true;
>> };
>>
>> static_assert(is_same<decltype(42LL), int>::value, "");
>
> My template-fu is weak; if someone wants to write such tests, more power to them.

LGTM then -- I will add such tests after this lands.  But please wait
for a review from Richard Smith.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list