Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions clang/test/CXX/drs/cwg1xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,26 @@ namespace cwg169 { // cwg169: yes
};
}

namespace cwg170 { // cwg170: 3.1
#if __cplusplus >= 201103L
struct A {};
struct B : A { int i; };
struct C : A {};
struct D : C {};

constexpr int f(int A::*) { return 0; }
constexpr int g(int C::*) { return 0; }
constexpr int h(int D::*) { return 0; }

constexpr auto p = static_cast<int A::*>(&B::i);
constexpr auto q = f(p);
constexpr auto r = g(p);
// since-cxx11-error@-1 {{constexpr variable 'r' must be initialized by a constant expression}}
constexpr auto s = h(p);
// since-cxx11-error@-1 {{constexpr variable 's' must be initialized by a constant expression}}
#endif
} // namespace cwg170

namespace { // cwg171: 3.4
int cwg171a;
}
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 @@ -1065,7 +1065,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
<td><a href="https://cplusplus.github.io/CWG/issues/170.html">170</a></td>
<td>DRWP</td>
<td>Pointer-to-member conversions</td>
<td class="unknown" align="center">Unknown</td>
<td class="full" align="center">Clang 3.1</td>
</tr>
<tr id="171">
<td><a href="https://cplusplus.github.io/CWG/issues/171.html">171</a></td>
Expand Down
Loading