[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Didn't know it. I'll revert this. @ashwinbanwari it looks like you need to remove the diagnostics with `extern "C++" main` and apply it with libc++ and land this finally. https://github.com/llvm/llvm-project/pull/146247 ___ cfe-com

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Qinkun Bao via cfe-commits
qinkunbao wrote: Hi, can you take a look at the buildbot failure? https://lab.llvm.org/buildbot/#/builders/55/builds/13509 https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Mikael Holmén via cfe-commits
mikaelholmen wrote: Hello, With this patch I get ``` Unexpectedly Passed Tests (5): llvm-libc++-shared.cfg.in :: libcxx/selftest/modules/std-and-std.compat-module.sh.cpp llvm-libc++-shared.cfg.in :: libcxx/selftest/modules/std-module.sh.cpp llvm-libc++-shared.cfg.in :: libcxx/selftest/mod

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-x86_64-debian-dylib` running on `gribozavr4` while building `clang` at step 6 "test-build-unified-tree-check-clang". Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/31648 Here is the r

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-x86_64-debian-fast` running on `gribozavr4` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/56/builds/29711 Here is the rel

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread via cfe-commits
github-actions[bot] wrote: @ashwinbanwari Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: FWIW, I fixed it in https://github.com/llvm/llvm-project/commit/5186d4aeeeca56a77404c2842e494524b7cdd4ba to avoid affecting more people longer. https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commit

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `premerge-monolithic-linux` running on `premerge-linux-1` while building `clang` at step 7 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/36443 Here is

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Jan Patrick Lehr via cfe-commits
jplehr wrote: > It seems I need to add the line `// WARNING-NEXT: > -Wmain-attached-to-named-module` on this > [line](https://sourcegraph.com/github.com/llvm/llvm-project/-/blob/clang/test/Driver/autocomplete.c?L114) > to fix the autocomplete test. > > What is the process to amend this PR? I

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-aarch64-darwin` running on `doug-worker-4` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/22459 Here is th

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Ashwin Banwari via cfe-commits
ashwinbanwari wrote: It seems I need to add the line `// WARNING-NEXT: -Wmain-attached-to-named-module` on this [line](https://sourcegraph.com/github.com/llvm/llvm-project/-/blob/clang/test/Driver/autocomplete.c?L114) to fix the autocomplete test. What is the process to amend this PR? https:

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-sie-ubuntu-fast` running on `sie-linux-worker` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/144/builds/28925

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `openmp-offload-amdgpu-runtime-2` running on `rocm-worker-hw-02` while building `clang` at step 7 "Add check check-clang". Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/8364 Here is the re

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Please use a new email name. We don't accept github.noreply mail. https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Ashwin Banwari via cfe-commits
https://github.com/ashwinbanwari updated https://github.com/llvm/llvm-project/pull/146247 >From f2ed0c7989d7e181004237a4fa2ba7ae1efe44ed Mon Sep 17 00:00:00 2001 From: Ashwin Banwari Date: Sat, 28 Jun 2025 16:19:55 -0700 Subject: [PATCH 01/10] add err_main_in_named_module --- clang/include/cl

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Ashwin Banwari via cfe-commits
https://github.com/ashwinbanwari edited https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
@@ -650,6 +650,9 @@ Improvements to Clang's diagnostics #GH69470, #GH59391, #GH58172, #GH46215, #GH45915, #GH45891, #GH44490, #GH36703, #GH32903, #GH23312, #GH69874. +- A warning is now emitted when ``main`` is attached to a named module, + which can be turned off with ``

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Ashwin Banwari via cfe-commits
https://github.com/ashwinbanwari updated https://github.com/llvm/llvm-project/pull/146247 >From f2ed0c7989d7e181004237a4fa2ba7ae1efe44ed Mon Sep 17 00:00:00 2001 From: Ashwin Banwari Date: Sat, 28 Jun 2025 16:19:55 -0700 Subject: [PATCH 1/9] add err_main_in_named_module --- clang/include/clan

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
@@ -1062,6 +1062,8 @@ def err_constexpr_main : Error< "'main' is not allowed to be declared %select{constexpr|consteval}0">; def err_deleted_main : Error<"'main' is not allowed to be deleted">; def err_mainlike_template_decl : Error<"%0 cannot be a template">; +def warn_main_

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
@@ -1062,6 +1062,8 @@ def err_constexpr_main : Error< "'main' is not allowed to be declared %select{constexpr|consteval}0">; def err_deleted_main : Error<"'main' is not allowed to be deleted">; def err_mainlike_template_decl : Error<"%0 cannot be a template">; +def warn_main_

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. Thanks. https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Ashwin Banwari via cfe-commits
https://github.com/ashwinbanwari edited https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Ashwin Banwari via cfe-commits
https://github.com/ashwinbanwari updated https://github.com/llvm/llvm-project/pull/146247 >From f2ed0c7989d7e181004237a4fa2ba7ae1efe44ed Mon Sep 17 00:00:00 2001 From: Ashwin Banwari Date: Sat, 28 Jun 2025 16:19:55 -0700 Subject: [PATCH 1/5] add err_main_in_named_module --- clang/include/clan

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-29 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I prefer a warning instead of hard error. There are already users who uses this. https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-29 Thread Mikail Bagishov via cfe-commits
MikailBag wrote: It seems that clang trunk [warns](https://godbolt.org/z/Geedq7o46) on `extern "C++" main`, which is now allowed after P3618. I think it will be helpful for the UX to land this change after that warning is fixed. https://github.com/llvm/llvm-project/pull/146247 ___

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-29 Thread Ashwin Banwari via cfe-commits
https://github.com/ashwinbanwari updated https://github.com/llvm/llvm-project/pull/146247 >From f2ed0c7989d7e181004237a4fa2ba7ae1efe44ed Mon Sep 17 00:00:00 2001 From: Ashwin Banwari Date: Sat, 28 Jun 2025 16:19:55 -0700 Subject: [PATCH 1/4] add err_main_in_named_module --- clang/include/clan

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-29 Thread Ashwin Banwari via cfe-commits
https://github.com/ashwinbanwari updated https://github.com/llvm/llvm-project/pull/146247 >From f2ed0c7989d7e181004237a4fa2ba7ae1efe44ed Mon Sep 17 00:00:00 2001 From: Ashwin Banwari Date: Sat, 28 Jun 2025 16:19:55 -0700 Subject: [PATCH 1/4] add err_main_in_named_module --- clang/include/clan

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-28 Thread via cfe-commits
Mr-Anyone wrote: You should add a test case and a release note for this patch to be accepted. https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-28 Thread Ashwin Banwari via cfe-commits
https://github.com/ashwinbanwari updated https://github.com/llvm/llvm-project/pull/146247 >From f2ed0c7989d7e181004237a4fa2ba7ae1efe44ed Mon Sep 17 00:00:00 2001 From: Ashwin Banwari Date: Sat, 28 Jun 2025 16:19:55 -0700 Subject: [PATCH 1/3] add err_main_in_named_module --- clang/include/clan

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-28 Thread Ashwin Banwari via cfe-commits
https://github.com/ashwinbanwari edited https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [modules] add err_main_in_named_module (PR #146247)

2025-06-28 Thread Ashwin Banwari via cfe-commits
https://github.com/ashwinbanwari edited https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [modules] add err_main_in_named_module (PR #146247)

2025-06-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ashwin Banwari (ashwinbanwari) Changes Close https://github.com/llvm/llvm-project/issues/146229 As the issue said, main shouldn't be in any modules. New Error Output: ``` /my/code/directory/main.cpp:3:1: error: 'main' cannot be attached t

[clang] [clang] [modules] add err_main_in_named_module (PR #146247)

2025-06-28 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] [clang] [modules] add err_main_in_named_module (PR #146247)

2025-06-28 Thread Ashwin Banwari via cfe-commits
https://github.com/ashwinbanwari created https://github.com/llvm/llvm-project/pull/146247 Close https://github.com/llvm/llvm-project/issues/146229 As the issue said, main shouldn't be in any modules. New Error Output: ``` /my/code/directory/main.cpp:3:1: error: 'main' cannot be attached to a n