• Clemens Hammacher's avatar
    [base] Fix CHECK/DCHECK macros for enum types · 38b586c6
    Clemens Hammacher authored
    The problem with enums is that neither is_integral, nor is_signed or
    is_unsigned is true for them. Thus, comparison with our CHECK/DCHECK
    macros always just uses the default comparison, which fails if the
    signedness of the underlying integer types does not match.
    This CL fixes this by considering the underlying integer type of an
    enum to choose the right comparison operator.
    
    R=ishell@chromium.org
    CC=ahaas@chromium.org
    
    Change-Id: I5ef56d1b86228e879f5866967ab7e709f1e97f0b
    Reviewed-on: https://chromium-review.googlesource.com/518123
    Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
    Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#45593}
    38b586c6
logging.h 13.1 KB