[clang] [clang] Add test for CWG2811 "Clarify "use" of main" (PR #96168)

2024-06-21 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/96168 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add test for CWG2811 "Clarify "use" of main" (PR #96168)

2024-06-20 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/96168 >From 7ac89c2758965fec2dd007954735e59d793d6a59 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 20 Jun 2024 14:07:37 +0300 Subject: [PATCH 1/4] [clang] Add test for CWG2811 "Clarify "use" of main" --

[clang] [clang] Add test for CWG2811 "Clarify "use" of main" (PR #96168)

2024-06-20 Thread Aaron Ballman via cfe-commits
@@ -964,7 +964,7 @@ def err_main_global_variable : def warn_main_redefined : Warning<"variable named 'main' with external linkage " "has undefined behavior">, InGroup; def ext_main_used : Extension< - "ISO C++ does not allow 'main' to be used by a program">, InGroup; + "

[clang] [clang] Add test for CWG2811 "Clarify "use" of main" (PR #96168)

2024-06-20 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/96168 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add test for CWG2811 "Clarify "use" of main" (PR #96168)

2024-06-20 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM if @AaronBallman is happy ("expressions that... are an extensions" still sounds weird to me, cf previous comment) https://github.com/llvm/llvm-project/pull/96168 ___ cfe-commits mailing lis

[clang] [clang] Add test for CWG2811 "Clarify "use" of main" (PR #96168)

2024-06-20 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > do we have test that this is fine? > > ``` > namespace foo { > int main(); > using a = decltype(&main); > }``` > ``` Thank you, I added the tests. https://github.com/llvm/llvm-project/pull/96168 ___ cfe-commits mailing list c

[clang] [clang] Add test for CWG2811 "Clarify "use" of main" (PR #96168)

2024-06-20 Thread Vlad Serebrennikov via cfe-commits
@@ -964,7 +964,7 @@ def err_main_global_variable : def warn_main_redefined : Warning<"variable named 'main' with external linkage " "has undefined behavior">, InGroup; def ext_main_used : Extension< - "ISO C++ does not allow 'main' to be used by a program">, InGroup; + "

[clang] [clang] Add test for CWG2811 "Clarify "use" of main" (PR #96168)

2024-06-20 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/96168 >From 7ac89c2758965fec2dd007954735e59d793d6a59 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 20 Jun 2024 14:07:37 +0300 Subject: [PATCH 1/3] [clang] Add test for CWG2811 "Clarify "use" of main" --

[clang] [clang] Add test for CWG2811 "Clarify "use" of main" (PR #96168)

2024-06-20 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/96168 >From 7ac89c2758965fec2dd007954735e59d793d6a59 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 20 Jun 2024 14:07:37 +0300 Subject: [PATCH 1/2] [clang] Add test for CWG2811 "Clarify "use" of main" --

[clang] [clang] Add test for CWG2811 "Clarify "use" of main" (PR #96168)

2024-06-20 Thread via cfe-commits
@@ -964,7 +964,7 @@ def err_main_global_variable : def warn_main_redefined : Warning<"variable named 'main' with external linkage " "has undefined behavior">, InGroup; def ext_main_used : Extension< - "ISO C++ does not allow 'main' to be used by a program">, InGroup; + "

[clang] [clang] Add test for CWG2811 "Clarify "use" of main" (PR #96168)

2024-06-20 Thread Aaron Ballman via cfe-commits
@@ -964,7 +964,7 @@ def err_main_global_variable : def warn_main_redefined : Warning<"variable named 'main' with external linkage " "has undefined behavior">, InGroup; def ext_main_used : Extension< - "ISO C++ does not allow 'main' to be used by a program">, InGroup; + "

[clang] [clang] Add test for CWG2811 "Clarify "use" of main" (PR #96168)

2024-06-20 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > it's clearer that it's not conforming (at the very least we should say > something like "clang extension" As someone who was a user of Clang not so long ago, I have to say that the only thing "ISO C++ requires" conveyed to me was "you're doing something wrong". For me it neve

[clang] [clang] Add test for CWG2811 "Clarify "use" of main" (PR #96168)

2024-06-20 Thread via cfe-commits
cor3ntin wrote: I think I prefer the current wording, it's clearer that it's not conforming (at the very least we should say something like "clang extension". and maybe "referring to main is a clang extension". LGTM otherwise do we have test that this is fine? ``` namespace foo { int main

[clang] [clang] Add test for CWG2811 "Clarify "use" of main" (PR #96168)

2024-06-20 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes This patch covers [CWG2811](https://cplusplus.github.io/CWG/issues/2811.html) "Clarify "use" of main", basically adding a test for `-Wmain`, focusing on usages of `main` in unevaluated contexts. To my

[clang] [clang] Add test for CWG2811 "Clarify "use" of main" (PR #96168)

2024-06-20 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/96168 This patch covers [CWG2811](https://cplusplus.github.io/CWG/issues/2811.html) "Clarify "use" of main", basically adding a test for `-Wmain`, focusing on usages of `main` in unevaluated contexts. To my understan