https://github.com/MitalAshok updated 
https://github.com/llvm/llvm-project/pull/101382

>From 9dcbd0779bf379bbf62bf52247ef46de82cb4877 Mon Sep 17 00:00:00 2001
From: Mital Ashok <mi...@mitalashok.co.uk>
Date: Wed, 31 Jul 2024 19:18:09 +0100
Subject: [PATCH 1/2] [clang][Tests][NFC] Add CWG882 test (Defining `main` as
 deleted)

---
 clang/test/CXX/drs/cwg8xx.cpp | 7 ++++++-
 clang/www/cxx_dr_status.html  | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/clang/test/CXX/drs/cwg8xx.cpp b/clang/test/CXX/drs/cwg8xx.cpp
index c8cbdfcee3f4d..86ee1c0c86b0d 100644
--- a/clang/test/CXX/drs/cwg8xx.cpp
+++ b/clang/test/CXX/drs/cwg8xx.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s 
-verify=expected,cxx98-17 -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s 
-verify=expected,cxx98-17,cxx98 -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s 
-verify=expected,cxx98-17,since-cxx11 -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s 
-verify=expected,cxx98-17,since-cxx11 -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s 
-verify=expected,cxx98-17,since-cxx11 -fexceptions -fcxx-exceptions 
-pedantic-errors
@@ -30,3 +30,8 @@ void g(int i) {
 }
 #endif
 } // namespace cwg873
+
+// cwg882: 3.5
+int main() = delete;
+// expected-error@-1 {{'main' is not allowed to be deleted}}
+// cxx98-error@-2 {{deleted function definitions are a C++11 extension}}
diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index 937f67981e296..0b3477fbd217b 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -5161,7 +5161,7 @@ <h2 id="cxxdr">C++ defect report implementation 
status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/882.html";>882</a></td>
     <td>CD2</td>
     <td>Defining <TT>main</TT> as deleted</td>
-    <td class="unknown" align="center">Unknown</td>
+    <td class="full" align="center">Clang 3.5</td>
   </tr>
   <tr id="883">
     <td><a href="https://cplusplus.github.io/CWG/issues/883.html";>883</a></td>

>From 422b306ac043c236714161ef33e28a6c7456eac5 Mon Sep 17 00:00:00 2001
From: Mital Ashok <mi...@mitalashok.co.uk>
Date: Wed, 31 Jul 2024 20:27:32 +0100
Subject: [PATCH 2/2] Check for C++11

---
 clang/test/CXX/drs/cwg8xx.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/clang/test/CXX/drs/cwg8xx.cpp b/clang/test/CXX/drs/cwg8xx.cpp
index 86ee1c0c86b0d..38bff3adf262a 100644
--- a/clang/test/CXX/drs/cwg8xx.cpp
+++ b/clang/test/CXX/drs/cwg8xx.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s 
-verify=expected,cxx98-17,cxx98 -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s 
-verify=expected,cxx98-17 -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s 
-verify=expected,cxx98-17,since-cxx11 -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s 
-verify=expected,cxx98-17,since-cxx11 -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s 
-verify=expected,cxx98-17,since-cxx11 -fexceptions -fcxx-exceptions 
-pedantic-errors
@@ -32,6 +32,7 @@ void g(int i) {
 } // namespace cwg873
 
 // cwg882: 3.5
+#if __cplusplus >= 201103L
 int main() = delete;
-// expected-error@-1 {{'main' is not allowed to be deleted}}
-// cxx98-error@-2 {{deleted function definitions are a C++11 extension}}
+// since-cxx11-error@-1 {{'main' is not allowed to be deleted}}
+#endif

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to