-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clang incorrectly thinks that enumerators of enum does not fit in the largest integer type #24667
Comments
wheatman
added a commit
to wheatman/llvm-project
that referenced
this issue
Jan 19, 2024
Enums which do not have a specified type can only grow to bigger types which contain more bits than the prior types. This means that the largest signed integer type cannot grow to the largest unsigned integer types. Fixes llvm#24667
wheatman
added a commit
to wheatman/llvm-project
that referenced
this issue
Jan 23, 2024
Enums which do not have a specified type can only grow to bigger types which contain more bits than the prior types. This means that the largest signed integer type cannot grow to the largest unsigned integer types. Fixes llvm#24667
wheatman
added a commit
to wheatman/llvm-project
that referenced
this issue
Jan 27, 2024
Enums which do not have a specified type can only grow to bigger types which contain more bits than the prior types. This means that the largest signed integer type cannot grow to the largest unsigned integer types. Fixes llvm#24667
wheatman
added a commit
to wheatman/llvm-project
that referenced
this issue
Jan 27, 2024
Enums which do not have a specified type can only grow to bigger types which contain more bits than the prior types. This means that the largest signed integer type cannot grow to the largest unsigned integer types. Fixes llvm#24667
wheatman
added a commit
to wheatman/llvm-project
that referenced
this issue
Feb 18, 2024
Enums which do not have a specified type can only grow to bigger types which contain more bits than the prior types. This means that the largest signed integer type cannot grow to the largest unsigned integer types. In the Process also implements N3029 Improved Normal Enumerations and N3030 Enhancements to Enumerations which brings C enums more inline with C++ enums. Fixes llvm#24667
wheatman
added a commit
to wheatman/llvm-project
that referenced
this issue
Feb 25, 2024
Enums which do not have a specified type can only grow to bigger types which contain more bits than the prior types. This means that the largest signed integer type cannot grow to the largest unsigned integer types. In the Process also implements N3029 Improved Normal Enumerations and N3030 Enhancements to Enumerations which brings C enums more inline with C++ enums. Fixes llvm#24667
wheatman
added a commit
to wheatman/llvm-project
that referenced
this issue
Mar 20, 2024
Enums which do not have a specified type can only grow to bigger types which contain more bits than the prior types. This means that the largest signed integer type cannot grow to the largest unsigned integer types. In the Process also implements N3029 Improved Normal Enumerations and N3030 Enhancements to Enumerations which brings C enums more inline with C++ enums. Fixes llvm#24667
wheatman
added a commit
to wheatman/llvm-project
that referenced
this issue
Mar 20, 2024
Enums which do not have a specified type can only grow to bigger types which contain more bits than the prior types. This means that the largest signed integer type cannot grow to the largest unsigned integer types. In the process also implements N3029 Improved Normal Enumerations and patially implements N3030 Enhancements to Enumerations which brings C enums more inline with C++ enums. Fixes llvm#24667
wheatman
added a commit
to wheatman/llvm-project
that referenced
this issue
Mar 21, 2024
Enums which do not have a specified type can only grow to bigger types which contain more bits than the prior types. This means that the largest signed integer type cannot grow to the largest unsigned integer types. In the process also implements N3029 Improved Normal Enumerations and patially implements N3030 Enhancements to Enumerations which brings C enums more inline with C++ enums. Fixes llvm#24667
wheatman
added a commit
to wheatman/llvm-project
that referenced
this issue
Mar 21, 2024
Enums which do not have a specified type can only grow to bigger types which contain more bits than the prior types. This means that the largest signed integer type cannot grow to the largest unsigned integer types. In the process also implements N3029 Improved Normal Enumerations and patially implements N3030 Enhancements to Enumerations which brings C enums more inline with C++ enums. Fixes llvm#24667
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Extended Description
Consider the following well-formed program (prog.cc):
#include
enum E { x = std::numeric_limits::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::max(), y };
^
1 error generated.
The text was updated successfully, but these errors were encountered: