This revision was automatically updated to reflect the committed changes. Closed by commit rG238f15820e71: [clang] Add test for CWG873 (authored by Endill).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151704/new/ https://reviews.llvm.org/D151704 Files: clang/test/CXX/drs/dr6xx.cpp clang/test/CXX/drs/dr8xx.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 @@ -3767,7 +3767,7 @@ <td><a href="https://cplusplus.github.io/CWG/issues/621.html">621</a></td> <td>C++11</td> <td>Template argument deduction from function return types</td> - <td class="none" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="622"> <td><a href="https://cplusplus.github.io/CWG/issues/622.html">622</a></td> @@ -5117,7 +5117,7 @@ <td><a href="https://cplusplus.github.io/CWG/issues/873.html">873</a></td> <td>C++11</td> <td>Deducing rvalue references in declarative contexts</td> - <td class="none" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="874"> <td><a href="https://cplusplus.github.io/CWG/issues/874.html">874</a></td> Index: clang/test/CXX/drs/dr8xx.cpp =================================================================== --- /dev/null +++ clang/test/CXX/drs/dr8xx.cpp @@ -0,0 +1,30 @@ +// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s +// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s +// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s +// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s +// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s +// RUN: %clang_cc1 -std=c++2c -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s + +// expected-no-diagnostics + +namespace dr873 { // dr873: yes +#if __cplusplus >= 201103L +template <typename T> void f(T &&); +template <> void f(int &) {} // #1 +template <> void f(int &&) {} // #2 +void g(int i) { + f(i); // calls f<int&>(int&), i.e., #1 +#pragma clang __debug dump f(i) + // CHECK: CallExpr {{.*}} + // CHECK-NEXT: |-ImplicitCastExpr {{.*}} + // CHECK-NEXT: | `-DeclRefExpr {{.*}} 'f' 'void (int &)' {{.*}} + + f(0); // calls f<int>(int&&), i.e., #2 +#pragma clang __debug dump f(0) + // CHECK: CallExpr {{.*}} + // CHECK-NEXT: |-ImplicitCastExpr {{.*}} + // CHECK-NEXT: | `-DeclRefExpr {{.*}} 'f' 'void (int &&)' {{.*}} +} +#endif +} // namespace dr873 Index: clang/test/CXX/drs/dr6xx.cpp =================================================================== --- clang/test/CXX/drs/dr6xx.cpp +++ clang/test/CXX/drs/dr6xx.cpp @@ -234,7 +234,7 @@ // dr620: dup 568 -namespace dr621 { +namespace dr621 { // dr621: yes template<typename T> T f(); template<> int f() {} // expected-note {{previous}} template<> int f<int>() {} // expected-error {{redefinition}}
Index: clang/www/cxx_dr_status.html =================================================================== --- clang/www/cxx_dr_status.html +++ clang/www/cxx_dr_status.html @@ -3767,7 +3767,7 @@ <td><a href="https://cplusplus.github.io/CWG/issues/621.html">621</a></td> <td>C++11</td> <td>Template argument deduction from function return types</td> - <td class="none" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="622"> <td><a href="https://cplusplus.github.io/CWG/issues/622.html">622</a></td> @@ -5117,7 +5117,7 @@ <td><a href="https://cplusplus.github.io/CWG/issues/873.html">873</a></td> <td>C++11</td> <td>Deducing rvalue references in declarative contexts</td> - <td class="none" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="874"> <td><a href="https://cplusplus.github.io/CWG/issues/874.html">874</a></td> Index: clang/test/CXX/drs/dr8xx.cpp =================================================================== --- /dev/null +++ clang/test/CXX/drs/dr8xx.cpp @@ -0,0 +1,30 @@ +// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s +// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s +// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s +// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s +// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s +// RUN: %clang_cc1 -std=c++2c -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s + +// expected-no-diagnostics + +namespace dr873 { // dr873: yes +#if __cplusplus >= 201103L +template <typename T> void f(T &&); +template <> void f(int &) {} // #1 +template <> void f(int &&) {} // #2 +void g(int i) { + f(i); // calls f<int&>(int&), i.e., #1 +#pragma clang __debug dump f(i) + // CHECK: CallExpr {{.*}} + // CHECK-NEXT: |-ImplicitCastExpr {{.*}} + // CHECK-NEXT: | `-DeclRefExpr {{.*}} 'f' 'void (int &)' {{.*}} + + f(0); // calls f<int>(int&&), i.e., #2 +#pragma clang __debug dump f(0) + // CHECK: CallExpr {{.*}} + // CHECK-NEXT: |-ImplicitCastExpr {{.*}} + // CHECK-NEXT: | `-DeclRefExpr {{.*}} 'f' 'void (int &&)' {{.*}} +} +#endif +} // namespace dr873 Index: clang/test/CXX/drs/dr6xx.cpp =================================================================== --- clang/test/CXX/drs/dr6xx.cpp +++ clang/test/CXX/drs/dr6xx.cpp @@ -234,7 +234,7 @@ // dr620: dup 568 -namespace dr621 { +namespace dr621 { // dr621: yes template<typename T> T f(); template<> int f() {} // expected-note {{previous}} template<> int f<int>() {} // expected-error {{redefinition}}
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits