Skip to content

Commit

Permalink
[clang] Add test for CWG255
Browse files Browse the repository at this point in the history
[[https://wg21.link/p1787 | P1787]]: CWG255 (partially resolved by N3778 is resolved by generally specifying the restriction to usual deallocation functions.
Wording: In any case, any declarations other than of usual deallocation functions ([basic.stc.dynamic.deallocation]) are discarded. ([expr.delete]/9)

Reviewed By: #clang-language-wg, cor3ntin

Differential Revision: https://reviews.llvm.org/D147549
  • Loading branch information
Endilll committed Apr 7, 2023
1 parent 9af8dca commit 33e8431
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions clang/test/CXX/drs/dr2xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors

// PR13819 -- __SIZE_TYPE__ is incompatible.
typedef __SIZE_TYPE__ size_t; // expected-error 0-1 {{extension}}
Expand Down Expand Up @@ -692,6 +693,14 @@ namespace dr254 { // dr254: yes
A<C>::type n; // expected-note {{instantiation of}}
}

namespace dr255 { // dr255: yes
struct S {
void operator delete(void *){};
void operator delete(void *, int){};
};
void f(S *p) { delete p; }
} // namespace dr255

// dr256: dup 624

namespace dr257 { // dr257: yes
Expand Down
2 changes: 1 addition & 1 deletion clang/www/cxx_dr_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
<td><a href="https://wg21.link/cwg255">255</a></td>
<td>CD6</td>
<td>Placement deallocation functions and lookup ambiguity</td>
<td class="none" align="center">Unknown</td>
<td class="full" align="center">Yes</td>
</tr>
<tr id="256">
<td><a href="https://wg21.link/cwg256">256</a></td>
Expand Down

0 comments on commit 33e8431

Please sign in to comment.