Issue 240435
Summary [clang] Call becomes ambiguous depends on dependent in-class using declaration
Labels clang
Assignees
Reporter TabbySqui
    The test:
```c++
struct Vector3;
template <class T, unsigned = sizeof(T*)> class Vector {
  using I = T;
  Vector<I>* t;
};


template <typename Td, typename Ts>
void FitBuffer(Vector<Td>, Ts);
template <typename T>
void FitBuffer(Vector<Vector3>, T);
void SetVertexBufferData() {
 Vector<Vector3> bufferData;
  FitBuffer(bufferData, 0);
}
```
Output:
```
<source>:14:3: error: call to 'FitBuffer' is ambiguous
   14 |   FitBuffer(bufferData, 0);
      | ^~~~~~~~~
<source>:9:6: note: candidate function [with Td = Vector3, Ts = int]
    9 | void FitBuffer(Vector<Td>, Ts);
      |      ^
<source>:11:6: note: candidate function [with T = int]
   11 | void FitBuffer(Vector<Vector3>, T);
      |      ^
1 error generated.
Compiler returned: 1
```
https://godbolt.org/z/csb985ve9

If we remove the using from `Vector<I>* t;`(change to `Vector<T>* t;`) the compilation is successful.

Starts with clang-20
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to