Skip to content

Commit 30e5d71

Browse files
authored
1 parent 39826b1 commit 30e5d71

File tree

3 files changed

+58
-19
lines changed

3 files changed

+58
-19
lines changed

clang/test/CXX/drs/cwg15xx.cpp

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
1+
// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify=expected,cxx98 -fexceptions -fcxx-exceptions -pedantic-errors
22
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify=expected,cxx11-20,since-cxx11,cxx11-14 -fexceptions -fcxx-exceptions -pedantic-errors
33
// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify=expected,cxx11-20,since-cxx11,cxx11-14,cxx14-17 -fexceptions -fcxx-exceptions -pedantic-errors
44
// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify=expected,cxx11-20,since-cxx11,since-cxx17 -fexceptions -fcxx-exceptions -pedantic-errors
55
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify=expected,cxx11-20,since-cxx20,since-cxx11,since-cxx17 -fexceptions -fcxx-exceptions -pedantic-errors
66
// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx23,since-cxx20,since-cxx11,since-cxx17 -fexceptions -fcxx-exceptions -pedantic-errors
77
// RUN: %clang_cc1 -std=c++2c -triple x86_64-unknown-unknown %s -verify=expected,since-cxx23,since-cxx20,since-cxx11,since-cxx17 -fexceptions -fcxx-exceptions -pedantic-errors
88

9+
#if __cplusplus == 199711L
10+
#define static_assert(...) __extension__ _Static_assert(__VA_ARGS__)
11+
// cxx98-error@-1 {{variadic macros are a C99 feature}}
12+
#endif
13+
914
namespace cwg1512 { // cwg1512: 4
1015
void f(char *p) {
1116
if (p > 0) {}
@@ -556,24 +561,33 @@ auto CWG1579_lambda_invalid = []() -> GenericMoveOnly<char> {
556561
} // end namespace cwg1579
557562

558563
namespace cwg1584 { // cwg1584: 7 drafting 2015-05
559-
#if __cplusplus >= 201103L
560-
// Deducing function types from cv-qualified types
561-
template<typename T> void f(const T *); // #cwg1584-f
562-
template<typename T> void g(T *, const T * = 0);
563-
template<typename T> void h(T *) { T::error; }
564-
// since-cxx11-error@-1 {{type 'void ()' cannot be used prior to '::' because it has no members}}
565-
// since-cxx11-note@#cwg1584-h {{in instantiation of function template specialization 'cwg1584::h<void ()>' requested here}}
566-
template<typename T> void h(const T *);
567-
void i() {
568-
f(&i);
569-
// since-cxx11-error@-1 {{no matching function for call to 'f'}}
570-
// since-cxx11-note@#cwg1584-f {{candidate template ignored: could not match 'const T *' against 'void (*)()'}}
571-
g(&i);
572-
h(&i); // #cwg1584-h
573-
}
574-
#endif
564+
// Deducing function types from cv-qualified types
565+
template<typename T> void f(const T *); // #cwg1584-f
566+
template<typename T> void g(T *, const T * = 0);
567+
template<typename T> void h(T *) { T::error; }
568+
// expected-error@-1 {{type 'void ()' cannot be used prior to '::' because it has no members}}
569+
// expected-note@#cwg1584-h {{in instantiation of function template specialization 'cwg1584::h<void ()>' requested here}}
570+
template<typename T> void h(const T *);
571+
void i() {
572+
f(&i);
573+
// expected-error@-1 {{no matching function for call to 'f'}}
574+
// expected-note@#cwg1584-f {{candidate template ignored: could not match 'const T *' against 'void (*)()'}}
575+
g(&i);
576+
h(&i); // #cwg1584-h
575577
}
576578

579+
template<typename T> struct tuple_size {
580+
static const bool is_primary = true;
581+
};
582+
template<typename T> struct tuple_size<T const> : tuple_size<T> {
583+
static const bool is_primary = false;
584+
};
585+
586+
tuple_size<void()> t;
587+
static_assert(tuple_size<void()>::is_primary, "");
588+
static_assert(tuple_size<void()const>::is_primary, "");
589+
} // namespace cwg1584
590+
577591
namespace cwg1589 { // cwg1589: 3.7 c++11
578592
#if __cplusplus >= 201103L
579593
// Ambiguous ranking of list-initialization sequences

clang/test/CXX/drs/cwg7xx.cpp

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++98 %s -verify=expected,cxx98-14,cxx98-11 -fexceptions -fcxx-exceptions -pedantic-errors
1+
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++98 %s -verify=expected,cxx98,cxx98-14,cxx98-11 -fexceptions -fcxx-exceptions -pedantic-errors
22
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++11 %s -verify=expected,cxx98-14,cxx98-11,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
33
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++14 %s -verify=expected,cxx98-14,since-cxx14,since-cxx11,cxx14 -fexceptions -fcxx-exceptions -pedantic-errors
44
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++17 %s -verify=expected,since-cxx14,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
55
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++2a %s -verify=expected,since-cxx14,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
66

7+
#if __cplusplus == 199711L
8+
#define static_assert(...) __extension__ _Static_assert(__VA_ARGS__)
9+
// cxx98-error@-1 {{variadic macros are a C99 feature}}
10+
#endif
11+
712
namespace cwg705 { // cwg705: yes
813
namespace N {
914
struct S {};
@@ -71,6 +76,26 @@ namespace cwg712 { // cwg712: partial
7176
#endif
7277
}
7378

79+
namespace cwg713 { // cwg713: 3.0
80+
template<typename T>
81+
struct is_const {
82+
static const bool value = __is_const(T);
83+
};
84+
template<typename T>
85+
struct is_volatile {
86+
static const bool value = __is_volatile(T);
87+
};
88+
89+
static_assert(!is_const<void()const>::value, "");
90+
static_assert(!is_const<void()const volatile>::value, "");
91+
static_assert(!is_volatile<void()volatile>::value, "");
92+
static_assert(!is_volatile<void()const volatile>::value, "");
93+
#if __cplusplus >= 201103L
94+
static_assert(!is_const<void()const&>::value, "");
95+
static_assert(!is_volatile<void()volatile&>::value, "");
96+
#endif
97+
} // namespace cwg713
98+
7499
namespace cwg727 { // cwg727: partial
75100
struct A {
76101
template<typename T> struct C; // #cwg727-C

clang/www/cxx_dr_status.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4327,7 +4327,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
43274327
<td><a href="https://cplusplus.github.io/CWG/issues/713.html">713</a></td>
43284328
<td>CD2</td>
43294329
<td>Unclear note about cv-qualified function types</td>
4330-
<td class="unknown" align="center">Unknown</td>
4330+
<td class="full" align="center">Clang 3.0</td>
43314331
</tr>
43324332
<tr id="714">
43334333
<td><a href="https://cplusplus.github.io/CWG/issues/714.html">714</a></td>

0 commit comments

Comments
 (0)