Skip to content

clang should not warn -Wshorten-64-to-32 when it knows shorten is safe #164959

@rockeet

Description

@rockeet
#include <limits.h>
unsigned int cvt(unsigned long x) {
    [[assume(x <= UINT_MAX)]];
    return x;
}

shorten is safe with [[assume(x <= UINT_MAX)]];.
see https://godbolt.org/z/aoPjxco5r

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerduplicateResolved as duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions