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

            Bug ID: 24293
           Summary: Clang incorrectly thinks that enumerators of enum does
                    not fit in the largest integer type
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: anders.granlun...@gmail.com
                CC: llvmbugs@cs.uiuc.edu
    Classification: Unclassified

Consider the following well-formed program (prog.cc):

#include <limits>
enum E { x = std::numeric_limits<long long int>::max(), y };
int main() {}

Compile it with the following command line:

clang++ prog.cc -stdlib=libc++ -std=c++14 -pedantic-errors

The enumerators x and y fits in unsigned long long int, but clang incorrectly
gives the following error message:

prog.cc:2:57: error: incremented enumerator value 9223372036854775808 is not
representable in the largest integer type [-Werror,-Wenum-too-large]
enum E { x = std::numeric_limits<long long int>::max(), y };
                                                        ^
1 error generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
LLVMbugs@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to