[clang] [clang] Diagnose functions with too many parameters (PR #104833)

2024-08-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-x86_64-linux` running on `sanitizer-buildbot2` while building `clang` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/66/builds/2982 Here is the relevant piece of the bu

[clang] [clang] Diagnose functions with too many parameters (PR #104833)

2024-08-21 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/104833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Diagnose functions with too many parameters (PR #104833)

2024-08-21 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > @Endilll you forgot to update the tests - hence the ci failure Thank you! Should be good to go now https://github.com/llvm/llvm-project/pull/104833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [clang] Diagnose functions with too many parameters (PR #104833)

2024-08-21 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/104833 >From 424818620766cedb2770e076ee359afeb0cc14ec Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 19 Aug 2024 19:26:46 +0300 Subject: [PATCH 1/7] Add in-loop check --- clang/include/clang/AST/Type.h

[clang] [clang] Diagnose functions with too many parameters (PR #104833)

2024-08-21 Thread via cfe-commits
cor3ntin wrote: @Endilll you forgot to update the tests - hence the ci failure https://github.com/llvm/llvm-project/pull/104833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Diagnose functions with too many parameters (PR #104833)

2024-08-19 Thread Vlad Serebrennikov via cfe-commits
@@ -9311,6 +9311,9 @@ def note_constinit_missing_here : Note< def err_dimension_expr_not_constant_integer : Error< "dimension expression does not evaluate to a constant unsigned int">; +def err_function_parameter_limit_exceeded : Error< + "too many function parameters; subs

[clang] [clang] Diagnose functions with too many parameters (PR #104833)

2024-08-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/104833 >From 424818620766cedb2770e076ee359afeb0cc14ec Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 19 Aug 2024 19:26:46 +0300 Subject: [PATCH 1/6] Add in-loop check --- clang/include/clang/AST/Type.h

[clang] [clang] Diagnose functions with too many parameters (PR #104833)

2024-08-19 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/104833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Diagnose functions with too many parameters (PR #104833)

2024-08-19 Thread via cfe-commits
@@ -9311,6 +9311,9 @@ def note_constinit_missing_here : Note< def err_dimension_expr_not_constant_integer : Error< "dimension expression does not evaluate to a constant unsigned int">; +def err_function_parameter_limit_exceeded : Error< + "too many function parameters; subs

[clang] [clang] Diagnose functions with too many parameters (PR #104833)

2024-08-19 Thread via cfe-commits
@@ -8025,6 +8025,17 @@ void Parser::ParseParameterDeclarationClause( // Consume the keyword. ConsumeToken(); } + + // FunctionTypeBitfields::NumParams can only hold so much. cor3ntin wrote: ```suggestion // We can only store so

[clang] [clang] Diagnose functions with too many parameters (PR #104833)

2024-08-19 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/104833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Diagnose functions with too many parameters (PR #104833)

2024-08-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes This patch adds a parser check when a function declaration or function type declaration (in a function pointer declaration, for example) has too many parameters for `FunctionTypeBits::NumParams` to hol

[clang] [clang] Diagnose functions with too many parameters (PR #104833)

2024-08-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/104833 This patch adds a parser check when a function declaration or function type declaration (in a function pointer declaration, for example) has too many parameters for `FunctionTypeBits::NumParams` to hold. At the