Skip to content

Commit fa2948d

Browse files
committed
Add more tests. NFC.
1 parent 445c08b commit fa2948d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clang/test/SemaCXX/pmf-conversions.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ using pf_type_mismatched = void (*)(S*, int);
1515
#pragma clang diagnostic push
1616
#pragma clang diagnostic ignored "-Wpmf-conversions"
1717

18+
// constexpr pmf conversions are not supported yet.
19+
constexpr pf_type method_constexpr = reinterpret_cast<pf_type>(&S::method); // expected-error {{constexpr variable 'method_constexpr' must be initialized by a constant expression}} expected-note {{reinterpret_cast is not allowed in a constant expression}}
20+
pf_type method = reinterpret_cast<pf_type>(&S::method);
21+
1822
void pmf_convert_no_object(pmf_type method, pm_type field) {
1923
(void)reinterpret_cast<pf_type>(&S::method);
2024
(void)reinterpret_cast<pf_type>(method);

0 commit comments

Comments
 (0)