P1787: CWG2007 is resolved by skipping unqualified lookup for operators that must be member functions.
Wording: For the operators =, [], or ->, the set of non-member candidates is empty; otherwise, it includes the result of the unqualified lookup for operator@... ([over.match.oper]/3)
Details
- Reviewers
shafik - Group Reviewers
Restricted Project - Commits
- rGa4beecef8f40: [clang] Add test for CWG2007
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/test/CXX/drs/dr20xx.cpp | ||
---|---|---|
20 | It looks like gcc and MSVC also instantiate A<void> for this case: https://godbolt.org/z/8W8eYoa38 I have to think about it some more but if we believe clang is wrong here, you should file a bug report. |
clang/test/CXX/drs/dr20xx.cpp | ||
---|---|---|
20 | Does it mean that we should craft a better example? |
clang/test/CXX/drs/dr20xx.cpp | ||
---|---|---|
20 | Yes, we need a better example, something like this will work, maybe something like: cpp B<A<void> > arr[2]; auto x = arr->foo; |
Replace unary & with __builtin_addressof(). It prevents unnecessary template instantiation (presumably to find overloaded unary &), and make Clang compliant since 3.4
LGTM, thank you again for all the effort in documenting these and adding tests, it is much appreciated.
Credits go to Aaron, actually. We discussed this DR during his office hours yesterday.
Thank you for giving them thorough review.
It looks like gcc and MSVC also instantiate A<void> for this case: https://godbolt.org/z/8W8eYoa38
I have to think about it some more but if we believe clang is wrong here, you should file a bug report.