Skip to content

[clang] Add test for CWG794 "Base-derived conversion in member type of pointer-to-member conversion" #121660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2025
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
12 changes: 12 additions & 0 deletions clang/test/CXX/drs/cwg7xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,3 +337,15 @@ template <typename... T>
void h(int i = 0, T ...args, int j = 1) {}
#endif
}

namespace cwg794 { // cwg794: 2.7
struct B {};
struct D : B {};
struct X {
D d;
};
struct Y : X {};
B Y::*pm = &X::d;
// expected-error@-1 {{cannot initialize a variable of type 'B Y::*' with an rvalue of type 'D cwg794::X::*': different classes ('Y' vs 'cwg794::X')}}
// FIXME: why diagnostic says just `Y` and not `cwg794::Y`, like `cwg794::X`?
Comment on lines +349 to +350
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems to occur in HandleFunctionTypeMismatch - my best guess is that one is a canonical type and the other isn't? Not sure though

} // namespace cwg794
2 changes: 1 addition & 1 deletion clang/www/cxx_dr_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -4775,7 +4775,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
<td><a href="https://cplusplus.github.io/CWG/issues/794.html">794</a></td>
<td>NAD</td>
<td>Base-derived conversion in member type of pointer-to-member conversion</td>
<td class="unknown" align="center">Unknown</td>
<td class="full" align="center">Clang 2.7</td>
</tr>
<tr id="795">
<td><a href="https://cplusplus.github.io/CWG/issues/795.html">795</a></td>
Expand Down
Loading