Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
43 changes: 43 additions & 0 deletions clang/test/CXX/drs/cwg1xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,49 @@ namespace cwg155 { // cwg155: dup 632
// expected-warning@-1 {{braces around scalar initializer}}
}

namespace cwg156 { // cwg156: partial
namespace ex1 {
struct A {
operator int();
} a;
void foo() {
typedef int T;
a.operator T(); // T is found using unqualified lookup
// after qualified lookup in A fails.
}
} // namespace ex1

namespace ex2 {
struct A {
typedef int T;
operator T();
};
struct B : A {
operator T();
} b;
void foo() {
b.A::operator T(); // FIXME: qualified lookup should find T in A.
// expected-error@-1 {{unknown type name 'T'}}
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be #28181
Do we want to take a crack at it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is similar to that issue in a sense that T needs to undergo a qualified lookup, but the lookup context is different (nested name specifier here, type of the object expression there).

Do we want to take a crack at it?

Maybe, but not in this PR.

}
} // namespace ex2

namespace ex3 {
template <class T1> struct A {
operator T1();
};
template <class T2> struct B : A<T2> {
operator T2();
void foo() {
// In both cases, during instantiation, qualified lookup for T2 wouldn't be able
// to find anything, so T2 has to be found by unqualified lookup.
// After that, 'operator T2()' is found in A<T2> by qualfied lookup.
T2 a = A<T2>::operator T2();
T2 b = ((A<T2> *)this)->operator T2();
}
};
} // namespace ex3
} // namespace cwg156

// cwg158 is in cwg158.cpp

namespace cwg159 { // cwg159: 3.5
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 @@ -981,7 +981,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
<td><a href="https://cplusplus.github.io/CWG/issues/156.html">156</a></td>
<td>NAD</td>
<td>Name lookup for conversion functions</td>
<td class="unknown" align="center">Unknown</td>
<td class="partial" align="center">Partial</td>
</tr>
<tr class="open" id="157">
<td><a href="https://cplusplus.github.io/CWG/issues/157.html">157</a></td>
Expand Down
Loading