[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-18 Thread Jannick Kremer via cfe-commits
@@ -570,6 +570,26 @@ def test_enum_values_cpp(self): self.assertEqual(ham.kind, CursorKind.ENUM_CONSTANT_DECL) self.assertEqual(ham.enum_value, 0x100) +def test_enum_values_on_elaborated_type(self): +tu = get_tu( +"using myUType

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-18 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum approved this pull request. Rest looks good to me. Regarding releases, I'm not too familiar with the process here, but I believe backports aren't done unless it's a critical security bug or similar. @Endilll can you confirm, and do you also want to sign off on t

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-18 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/108769 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-17 Thread Dmitry Fursov via cfe-commits
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

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-17 Thread Dmitry Fursov via cfe-commits
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

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-16 Thread Jannick Kremer via cfe-commits
@@ -570,6 +570,25 @@ def test_enum_values_cpp(self): self.assertEqual(ham.kind, CursorKind.ENUM_CONSTANT_DECL) self.assertEqual(ham.enum_value, 0x100) +def test_enum_values_on_elaborated_type(self): +tu = get_tu( +"using myUType

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-16 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: Thanks a lot for the fix! Except for the syntax error noted by the CI and my other comment, this looks good to me. https://github.com/llvm/llvm-project/pull/108769 ___ cfe-commits mailing list cfe-commits@li

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-16 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/108769 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-16 Thread via cfe-commits
github-actions[bot] wrote: :warning: Python code formatter, darker found issues in your code. :warning: You can test this locally with the following command: ``bash darker --check --diff -r 4b27b5800f8c94ec010213e2a4ddf552cc282bce...800010fabe3160e701ff58f7789dd9e01c80451f clang

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-16 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/108769 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Dmitry Fursov (fursov) Changes 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 happ

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-15 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-15 Thread Dmitry Fursov via cfe-commits
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