[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-13 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon closed https://github.com/llvm/llvm-project/pull/103917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-12 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, thank you! https://github.com/llvm/llvm-project/pull/103917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-12 Thread Mariya Podchishchaeva via cfe-commits
Fznamznon wrote: ping @AaronBallman https://github.com/llvm/llvm-project/pull/103917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-06 Thread Mariya Podchishchaeva via cfe-commits
@@ -169,13 +169,19 @@ enum class GH42372_2 { One }; +enum IncOverflow { + V2 = __INT_MAX__, + V3 // c99-warning {{incremented enumerator value that is exceeding range of 'int' is a C23 extension}} +#if __STDC_VERSION__ >= 202311L Fznamznon wrote: I misse

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-06 Thread Mariya Podchishchaeva via cfe-commits
@@ -1,23 +1,23 @@ -// RUN: %clang_cc1 -triple %itanium_abi_triple %s -fsyntax-only -verify -pedantic +// RUN: %clang_cc1 -triple %itanium_abi_triple %s -fsyntax-only -verify=expected,c99 -pedantic Fznamznon wrote: Hmm, I think removing the prefix is more accura

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-06 Thread Mariya Podchishchaeva via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: %clang_cc1 -verify -triple x86_64-unknown-linux-gnu -fsyntax-only --embed-dir=%S/Inputs -std=c23 %s -pedantic -Wpre-c23-compat Fznamznon wrote: Done. https://github.com/llvm/llvm-project/pull/103917

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-06 Thread Mariya Podchishchaeva via cfe-commits
@@ -6194,9 +6195,12 @@ def err_misplaced_ivar : Error< def warn_ivars_in_interface : Warning< "declaration of instance variables in the interface is deprecated">, InGroup>, DefaultIgnore; -def ext_enum_value_not_int : Extension< - "ISO C restricts enumerator values to rang

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-06 Thread Mariya Podchishchaeva via cfe-commits
@@ -1039,7 +1039,8 @@ def err_opencl_invalid_param : Error< "declaring function parameter of type %0 is not allowed%select{; did you forget * ?|}1">; def err_opencl_invalid_return : Error< "declaring function return value of type %0 is not allowed %select{; did you forget

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-06 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon updated https://github.com/llvm/llvm-project/pull/103917 >From eee57bcc211a8a045c0102ebb2f4410d52d657f6 Mon Sep 17 00:00:00 2001 From: "Podchishchaeva, Mariya" Date: Wed, 14 Aug 2024 05:56:18 -0700 Subject: [PATCH 1/5] [clang][C23] Support N3029 Improved Normal Enum

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-05 Thread Aaron Ballman via cfe-commits
@@ -1,23 +1,23 @@ -// RUN: %clang_cc1 -triple %itanium_abi_triple %s -fsyntax-only -verify -pedantic +// RUN: %clang_cc1 -triple %itanium_abi_triple %s -fsyntax-only -verify=expected,c99 -pedantic AaronBallman wrote: Should this get `-std=c99`? https://github.

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-05 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: %clang_cc1 -verify -triple x86_64-unknown-linux-gnu -fsyntax-only --embed-dir=%S/Inputs -std=c23 %s -pedantic -Wpre-c23-compat AaronBallman wrote: You should split this into two `RUN` lines, one `-std=c23 -Wpre-c23-compat` and the othe

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-05 Thread Aaron Ballman via cfe-commits
@@ -1039,7 +1039,8 @@ def err_opencl_invalid_param : Error< "declaring function parameter of type %0 is not allowed%select{; did you forget * ?|}1">; def err_opencl_invalid_return : Error< "declaring function return value of type %0 is not allowed %select{; did you forget

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for working on this! https://github.com/llvm/llvm-project/pull/103917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-05 Thread Aaron Ballman via cfe-commits
@@ -6194,9 +6195,12 @@ def err_misplaced_ivar : Error< def warn_ivars_in_interface : Warning< "declaration of instance variables in the interface is deprecated">, InGroup>, DefaultIgnore; -def ext_enum_value_not_int : Extension< - "ISO C restricts enumerator values to rang

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/103917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-05 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: %clang_cc1 -verify -triple x86_64-unknown-linux-gnu -fsyntax-only --embed-dir=%S/Inputs -std=c23 %s -pedantic -Wpre-c23-compat AaronBallman wrote: ```suggestion // RUN: %clang_cc1 -verify -triple x86_64-unknown-linux-gnu -fsyntax-only

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-05 Thread Aaron Ballman via cfe-commits
@@ -169,13 +169,19 @@ enum class GH42372_2 { One }; +enum IncOverflow { + V2 = __INT_MAX__, + V3 // c99-warning {{incremented enumerator value that is exceeding range of 'int' is a C23 extension}} +#if __STDC_VERSION__ >= 202311L AaronBallman wrote: You

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-04 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/103917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-03 Thread Eli Friedman via cfe-commits
@@ -19553,17 +19555,18 @@ EnumConstantDecl *Sema::CheckEnumConstant(EnumDecl *Enum, // If we're not in C++, diagnose the overflow of enumerator values, // which in C99 means that the enumerator value is not representable in -// an int (C99 6.7.2.2p2).

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-02 Thread Mariya Podchishchaeva via cfe-commits
Fznamznon wrote: > Please fix the diagnostics in pre-C23 mode to mention that we're following > C23 rules. Sure, done. https://github.com/llvm/llvm-project/pull/103917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-02 Thread Mariya Podchishchaeva via cfe-commits
@@ -19474,11 +19474,12 @@ EnumConstantDecl *Sema::CheckEnumConstant(EnumDecl *Enum, // representable as an int. // Complain if the value is not representable in an int. - if (!isRepresentableIntegerValue(Context, EnumVal, Context.IntTy)) -

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-02 Thread Mariya Podchishchaeva via cfe-commits
@@ -125,6 +125,8 @@ C2y Feature Support C23 Feature Support ^^^ +- Clang now supports `N3029 `_ Improved Normal Enumerations. Fznamznon wrote: Good catch, thanks! https://github.co

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-02 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon updated https://github.com/llvm/llvm-project/pull/103917 >From eee57bcc211a8a045c0102ebb2f4410d52d657f6 Mon Sep 17 00:00:00 2001 From: "Podchishchaeva, Mariya" Date: Wed, 14 Aug 2024 05:56:18 -0700 Subject: [PATCH 1/3] [clang][C23] Support N3029 Improved Normal Enum

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-08-19 Thread Mital Ashok via cfe-commits
@@ -125,6 +125,8 @@ C2y Feature Support C23 Feature Support ^^^ +- Clang now supports `N3029 `_ Improved Normal Enumerations. MitalAshok wrote: ```suggestion - Clang now supports `N

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-08-19 Thread Mital Ashok via cfe-commits
@@ -19474,11 +19474,12 @@ EnumConstantDecl *Sema::CheckEnumConstant(EnumDecl *Enum, // representable as an int. // Complain if the value is not representable in an int. - if (!isRepresentableIntegerValue(Context, EnumVal, Context.IntTy)) -

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-08-15 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon updated https://github.com/llvm/llvm-project/pull/103917 >From eee57bcc211a8a045c0102ebb2f4410d52d657f6 Mon Sep 17 00:00:00 2001 From: "Podchishchaeva, Mariya" Date: Wed, 14 Aug 2024 05:56:18 -0700 Subject: [PATCH 1/2] [clang][C23] Support N3029 Improved Normal Enum

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-08-15 Thread Mariya Podchishchaeva via cfe-commits
@@ -172,10 +172,8 @@ enum class GH42372_2 { #if __STDC_VERSION__ >= 202311L // FIXME: GCC picks __uint128_t as the underlying type for the enumeration // value and Clang picks unsigned long long. -// FIXME: Clang does not yet implement WG14 N3029, so the warning about -// restr

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-08-14 Thread via cfe-commits
@@ -172,10 +172,8 @@ enum class GH42372_2 { #if __STDC_VERSION__ >= 202311L // FIXME: GCC picks __uint128_t as the underlying type for the enumeration // value and Clang picks unsigned long long. -// FIXME: Clang does not yet implement WG14 N3029, so the warning about -// restr

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-08-14 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Please fix the diagnostics in pre-C23 mode to mention that we're following C23 rules. https://github.com/llvm/llvm-project/pull/103917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-08-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Mariya Podchishchaeva (Fznamznon) Changes Basically clang already implemented 90% of the feature as an extension. This commit disables warnings for C23 and aligns types of enumerators according to the recent wording. --- Full diff: https

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-08-14 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon created https://github.com/llvm/llvm-project/pull/103917 Basically clang already implemented 90% of the feature as an extension. This commit disables warnings for C23 and aligns types of enumerators according to the recent wording. >From eee57bcc211a8a045c0102ebb2