zero9178 created this revision. zero9178 added a reviewer: clang-language-wg. Herald added a project: All. zero9178 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
DR: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1305 This DR has always been implemented in all clang versions as far back as I could go. This patch basically just adds a test with the needed comments to mark it as complete. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D122674 Files: clang/test/CXX/drs/dr13xx.cpp clang/www/cxx_dr_status.html Index: clang/www/cxx_dr_status.html =================================================================== --- clang/www/cxx_dr_status.html +++ clang/www/cxx_dr_status.html @@ -7644,7 +7644,7 @@ <td><a href="https://wg21.link/cwg1305">1305</a></td> <td>CD3</td> <td><TT>alignof</TT> applied to array of unknown size</td> - <td class="none" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="1306"> <td><a href="https://wg21.link/cwg1306">1306</a></td> Index: clang/test/CXX/drs/dr13xx.cpp =================================================================== --- clang/test/CXX/drs/dr13xx.cpp +++ clang/test/CXX/drs/dr13xx.cpp @@ -3,6 +3,16 @@ // 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 +#if __cplusplus >= 201103L +namespace dr1305 { // dr1305: yes + struct Incomplete; // expected-note {{forward declaration of 'dr1305::Incomplete'}} + struct Complete {}; + + int incomplete = alignof(Incomplete(&)[]); // expected-error {{invalid application of 'alignof' to an incomplete type 'dr1305::Incomplete'}} + int complete = alignof(Complete(&)[]); +} +#endif + __extension__ typedef __SIZE_TYPE__ size_t; namespace std {
Index: clang/www/cxx_dr_status.html =================================================================== --- clang/www/cxx_dr_status.html +++ clang/www/cxx_dr_status.html @@ -7644,7 +7644,7 @@ <td><a href="https://wg21.link/cwg1305">1305</a></td> <td>CD3</td> <td><TT>alignof</TT> applied to array of unknown size</td> - <td class="none" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="1306"> <td><a href="https://wg21.link/cwg1306">1306</a></td> Index: clang/test/CXX/drs/dr13xx.cpp =================================================================== --- clang/test/CXX/drs/dr13xx.cpp +++ clang/test/CXX/drs/dr13xx.cpp @@ -3,6 +3,16 @@ // 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 +#if __cplusplus >= 201103L +namespace dr1305 { // dr1305: yes + struct Incomplete; // expected-note {{forward declaration of 'dr1305::Incomplete'}} + struct Complete {}; + + int incomplete = alignof(Incomplete(&)[]); // expected-error {{invalid application of 'alignof' to an incomplete type 'dr1305::Incomplete'}} + int complete = alignof(Complete(&)[]); +} +#endif + __extension__ typedef __SIZE_TYPE__ size_t; namespace std {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits