Skip to content

[clang] Cover CWG issues about export template #94876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/test/CXX/drs/cwg2xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace cwg202 { // cwg202: 3.1
template struct X<f>;
}

// FIXME (export) cwg204: no
// cwg204: sup 820

namespace cwg206 { // cwg206: yes
struct S; // #cwg206-S
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CXX/drs/cwg3xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ namespace cwg322 { // cwg322: 2.8
int &s = a;
}

// cwg323: no
// cwg323: sup 820

namespace cwg324 { // cwg324: 3.6
struct S { int n : 1; } s; // #cwg324-n
Expand Down Expand Up @@ -587,7 +587,7 @@ namespace cwg334 { // cwg334: yes
template void f<S>();
}

// cwg335: no
// cwg335: sup 820

namespace cwg336 { // cwg336: yes
namespace Pre {
Expand Down
25 changes: 15 additions & 10 deletions clang/test/CXX/drs/cwg8xx.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++2c -triple x86_64-unknown-unknown %s -verify=expected,since-cxx11 -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
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx20,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx20,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++2c -triple x86_64-unknown-unknown %s -verify=expected,since-cxx20,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors

#if __cplusplus == 199711L
// expected-no-diagnostics
#endif
namespace cwg820 { // cwg820: 2.7
export template <class T> struct B {};
// cxx98-17-warning@-1 {{exported templates are unsupported}}
// since-cxx20-error@-2 {{export declaration can only be used within a module purview}}
export template<typename T> void f() {}
// cxx98-17-warning@-1 {{exported templates are unsupported}}
// since-cxx20-error@-2 {{export declaration can only be used within a module purview}}
}

namespace cwg873 { // cwg873: 3.0
#if __cplusplus >= 201103L
Expand Down
8 changes: 4 additions & 4 deletions clang/www/cxx_dr_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
<td><a href="https://cplusplus.github.io/CWG/issues/204.html">204</a></td>
<td>CD1</td>
<td>Exported class templates</td>
<td class="none" align="center">No</td>
<td class="full-superseded" align="center">Superseded by <a href="#820">820</a></td>
</tr>
<tr class="open" id="205">
<td><a href="https://cplusplus.github.io/CWG/issues/205.html">205</a></td>
Expand Down Expand Up @@ -1985,7 +1985,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
<td><a href="https://cplusplus.github.io/CWG/issues/323.html">323</a></td>
<td>CD1</td>
<td>Where must <TT>export</TT> appear?</td>
<td class="none" align="center">No</td>
<td class="full-superseded" align="center">Superseded by <a href="#820">820</a></td>
</tr>
<tr id="324">
<td><a href="https://cplusplus.github.io/CWG/issues/324.html">324</a></td>
Expand Down Expand Up @@ -2057,7 +2057,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
<td><a href="https://cplusplus.github.io/CWG/issues/335.html">335</a></td>
<td>CD1</td>
<td>Allowing <TT>export</TT> on template members of nontemplate classes</td>
<td class="none" align="center">No</td>
<td class="full-superseded" align="center">Superseded by <a href="#820">820</a></td>
</tr>
<tr id="336">
<td><a href="https://cplusplus.github.io/CWG/issues/336.html">336</a></td>
Expand Down Expand Up @@ -4921,7 +4921,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
<td><a href="https://cplusplus.github.io/CWG/issues/820.html">820</a></td>
<td>CD2</td>
<td>Deprecation of <TT>export</TT></td>
<td class="unknown" align="center">Unknown</td>
<td class="full" align="center">Clang 2.7</td>
</tr>
<tr id="822">
<td><a href="https://cplusplus.github.io/CWG/issues/822.html">822</a></td>
Expand Down
Loading