llvm-project
10fb5d2b - [clang] Add test for CWG203 "Type of address-of-member expression" (#121687)

Commit
267 days ago
[clang] Add test for CWG203 "Type of address-of-member expression" (#121687) This patch adds test for [CWG203](https://cplusplus.github.io/CWG/issues/203.html). Author was asking to change the type of pointer-to-member expression to be closer to how it's written as opposed to where the resulting member belongs to, but was turned down due to backwards compatibility concerns, so we're testing the status quo. There are a total of 6 examples in the filing, so I decided to just throw all of them into the test. I had to turn example 2 into `constexpr` test that unfortunately requires C++20. Outcomes in example 5 that Tomasz expected are not in line with implementation behavior and my reading of the Standard. I think he got confused by the fact that unlike regular pointers, pointers-to-members can be implicitly _downcasted_, but not upcasted. I left comments in the example.
Author
Parents
Loading