https://bugs.llvm.org/show_bug.cgi?id=44532

            Bug ID: 44532
           Summary: clang-cl will incorrectly warn on enum size
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

clang-cl will warn about enum representation on windows. On Linux, everything
works fine: https://godbolt.org/z/DpbxB3

AFAIU as per the standard the enum will have the type needed to fit the member,
so I don't understand the warning.

>clang-cl -c -std:c++17 -Weverything a.cpp
a.cpp(3,5): warning: enumerator value is not representable in the underlying
type 'int' [-Wmicrosoft-enum-value]
    e = 0xFFFFFFFFL
    ^
1 warning generated.

C:\Users\tiagoma\AppData\Local\Temp\temp>type a.cpp
enum
{
    e = 0xFFFFFFFFL
};

>clang-cl -c -std:c++17 -Weverything a.cpp
a.cpp(3,5): warning: enumerator value is not representable in the underlying
type 'int' [-Wmicrosoft-enum-value]
    e = 0xFFFFFFFFL
    ^
1 warning generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to