[clang] [clang][Tests][NFC] Add CWG882 test (Defining `main` as deleted) (PR #101382)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 31 11:23:39 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Mital Ashok (MitalAshok)
<details>
<summary>Changes</summary>
https://cplusplus.github.io/CWG/issues/882.html
This was implemented for Clang 3.5 by b63b6ee9a00ef0710d899df6cfda78a1b8bd762a
---
Full diff: https://github.com/llvm/llvm-project/pull/101382.diff
2 Files Affected:
- (modified) clang/test/CXX/drs/cwg8xx.cpp (+6-1)
- (modified) clang/www/cxx_dr_status.html (+1-1)
``````````diff
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 at -1 {{'main' is not allowed to be deleted}}
+// cxx98-error at -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>
``````````
</details>
https://github.com/llvm/llvm-project/pull/101382
More information about the cfe-commits
mailing list