Skip to content

Find All References thinks two references are different if a template argument has a different typedef #14344

@sean-mcmanus

Description

@sean-mcmanus

Repro is find all references on func1 below (found by Copilot via C/C++ DevTools):

test1.h:

template <typename T>
struct vector1 {
    T t;
};
template <typename T>
struct basic_string1 {};
using string1 = basic_string1<char>;

test1.cpp:

#include "test1.h"

void func1(vector1<string1> &a) {}

test2.cpp

#include "test1.h"
using u8string1 = vector1<basic_string1<char>>;
extern void func1(vector1<string1> &a);

int func2()
{
    vector1<string1> v;
    func1(v);
}

Bug: The implementation ends up comparing string1 with u8string1 as not being equal. The bug doesn't repro with VS, which has a different implementation which somehow resolves the comparison correctly.

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions