@@ -1952,6 +1952,8 @@ def enum_value(self):
underlying_type = self.type
if underlying_type.kind == TypeKind.ENUM:
underlying_type = underlying_type.get_declaration().enum_type
+if underlying_type.kind == TypeKind.ELABORATED:
-
@@ -1952,6 +1952,8 @@ def enum_value(self):
underlying_type = self.type
if underlying_type.kind == TypeKind.ENUM:
underlying_type = underlying_type.get_declaration().enum_type
+if underlying_type.kind == TypeKind.ELABORATED:
-
https://github.com/fursov edited
https://github.com/llvm/llvm-project/pull/108769
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1952,6 +1952,8 @@ def enum_value(self):
underlying_type = self.type
if underlying_type.kind == TypeKind.ENUM:
underlying_type = underlying_type.get_declaration().enum_type
+if underlying_type.kind == TypeKind.ELABORATED:
-
fursov wrote:
Sorry, I'm not familiar with the process (this is my first PR on github) - how
the change gets now to the repo? Someone from llvm-project should push it?
https://github.com/llvm/llvm-project/pull/108769
___
cfe-commits mailing list
cfe-c
https://github.com/fursov updated
https://github.com/llvm/llvm-project/pull/108769
>From 4d9f2e2e9ac57b4279a4aafc078a3b4fb3ff646f Mon Sep 17 00:00:00 2001
From: Dmitry Fursov
Date: Sun, 15 Sep 2024 18:14:48 +0300
Subject: [PATCH 1/2] Fix evaluation of the unsigned enumeration values
If the typ
fursov wrote:
@DeinAlptraum, thank you for the review. The findings are fixed now.
Could you say if the fix to be backported to other relelases, like 18.x or
19rc? If yes, how this is done?
https://github.com/llvm/llvm-project/pull/108769
___
cfe-comm
https://github.com/fursov updated
https://github.com/llvm/llvm-project/pull/108769
>From 4d9f2e2e9ac57b4279a4aafc078a3b4fb3ff646f Mon Sep 17 00:00:00 2001
From: Dmitry Fursov
Date: Sun, 15 Sep 2024 18:14:48 +0300
Subject: [PATCH] Fix evaluation of the unsigned enumeration values
If the type of
https://github.com/fursov created
https://github.com/llvm/llvm-project/pull/108769
If the type of an enumeration is not native (e.g. uint8_t) but is unsigned then
evaluation of the value might get wrong: for values bigger than half of type
range the return value will be negative. This happens